User: juhalindfors
Date: 02/04/10 12:29:00
Modified: src/main/javax/management
NotificationBroadcasterSupport.java
Log:
styling
Revision Changes Path
1.3 +35 -19
jmx/src/main/javax/management/NotificationBroadcasterSupport.java
Index: NotificationBroadcasterSupport.java
===================================================================
RCS file:
/cvsroot/jboss/jmx/src/main/javax/management/NotificationBroadcasterSupport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NotificationBroadcasterSupport.java 12 Jan 2002 20:03:30 -0000 1.2
+++ NotificationBroadcasterSupport.java 10 Apr 2002 19:28:59 -0000 1.3
@@ -1,5 +1,8 @@
/*
- * LGPL
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
*/
package javax.management;
@@ -7,45 +10,60 @@
import java.util.HashMap;
import java.util.Iterator;
-public class NotificationBroadcasterSupport implements NotificationBroadcaster {
+/**
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
+ * @version $Revision: 1.3 $
+ *
+ */
+public class NotificationBroadcasterSupport implements NotificationBroadcaster
+{
private HashMap listenerMap = new HashMap();
- public NotificationBroadcasterSupport() {}
+ public NotificationBroadcasterSupport()
+ {}
- public void addNotificationListener(NotificationListener listener,
NotificationFilter filter, Object handback) {
+ public void addNotificationListener(NotificationListener listener,
NotificationFilter filter, Object handback)
+ {
Map hbMap = (Map)listenerMap.get(listener);
-
+
if (hbMap != null)
hbMap.put(handback, filter);
- else {
+ else
+ {
hbMap = new HashMap();
hbMap.put(handback, filter);
listenerMap.put(listener, hbMap);
}
}
- public void removeNotificationListener(NotificationListener listener) throws
ListenerNotFoundException {
+ public void removeNotificationListener(NotificationListener listener) throws
ListenerNotFoundException
+ {
listenerMap.remove(listener);
}
- public MBeanNotificationInfo[] getNotificationInfo() {
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
return null;
}
- public void sendNotification(Notification notification) {
-
+ public void sendNotification(Notification notification)
+ {
+
Iterator listenerIterator = listenerMap.keySet().iterator();
-
- while(listenerIterator.hasNext()) {
+
+ while(listenerIterator.hasNext())
+ {
NotificationListener listener =
(NotificationListener)listenerIterator.next();
Map hbMap = (Map)listenerMap.get(listener);
Iterator it = hbMap.keySet().iterator();
-
- while(it.hasNext()) {
+
+ while(it.hasNext())
+ {
Object hb = it.next();
- NotificationFilter filter = (NotificationFilter)hbMap.get(hb);
-
+ NotificationFilter filter = (NotificationFilter)hbMap.get(hb);
+
if (filter == null)
listener.handleNotification(notification, hb);
else if (filter.isNotificationEnabled(notification))
@@ -54,7 +72,5 @@
}
}
-
-
-
}
+
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development