1 /***
2 *
3 * Copyright RAJD Consultancy Ltd
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
11 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 * specific language governing permissions and limitations under the License.
13 *
14 */
15 package org.logicblaze.lingo.jmx.remote.jms;
16
17 import javax.management.NotificationFilter;
18 import javax.management.NotificationListener;
19 /***
20 * @version $Revision: 1.1 $
21 */
22 class ListenerInfo{
23 private String id;
24 private NotificationListener listener;
25 private NotificationFilter filter;
26 private Object handback;
27
28 /***
29 * Constructor for a ListenerInfo
30 * @param id
31 * @param listener
32 * @param filter
33 * @param handback
34 */
35 public ListenerInfo(String id,NotificationListener listener,NotificationFilter filter,Object handback){
36 this.id = id;
37 this.listener=listener;
38 this.filter=filter;
39 this.handback=handback;
40 }
41
42 /***
43 * Is this info a match ?
44 * @param l
45 * @param f
46 * @param handback
47 * @return true if a match
48 */
49 public boolean isMatch(NotificationListener l,NotificationFilter f,Object handback){
50 return listener==listener&&filter==filter&&handback==handback;
51 }
52
53 /***
54 * @return Returns the filter.
55 */
56 public NotificationFilter getFilter(){
57 return filter;
58 }
59
60 /***
61 * @param filter The filter to set.
62 */
63 public void setFilter(NotificationFilter filter){
64 this.filter=filter;
65 }
66
67 /***
68 * @return Returns the handback.
69 */
70 public Object getHandback(){
71 return handback;
72 }
73
74 /***
75 * @param handback The handback to set.
76 */
77 public void setHandback(Object handback){
78 this.handback=handback;
79 }
80
81 /***
82 * @return Returns the id.
83 */
84 public String getId(){
85 return id;
86 }
87
88 /***
89 * @param id The id to set.
90 */
91 public void setId(String id){
92 this.id=id;
93 }
94
95 /***
96 * @return Returns the listener.
97 */
98 public NotificationListener getListener(){
99 return listener;
100 }
101
102 /***
103 * @param listener The listener to set.
104 */
105 public void setListener(NotificationListener listener){
106 this.listener=listener;
107 }
108
109 }