[jboss-cvs] JBossAS SVN: r94155 - projects/aop/branches/Branch_2_1/asintegration-jmx/src/main/java/org/jboss/aop/deployment.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 30 09:29:07 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-09-30 09:29:07 -0400 (Wed, 30 Sep 2009)
New Revision: 94155
Modified:
projects/aop/branches/Branch_2_1/asintegration-jmx/src/main/java/org/jboss/aop/deployment/AspectManagerService.java
Log:
[JBAOP-754] Add the notification support properly
Modified: projects/aop/branches/Branch_2_1/asintegration-jmx/src/main/java/org/jboss/aop/deployment/AspectManagerService.java
===================================================================
--- projects/aop/branches/Branch_2_1/asintegration-jmx/src/main/java/org/jboss/aop/deployment/AspectManagerService.java 2009-09-30 13:28:16 UTC (rev 94154)
+++ projects/aop/branches/Branch_2_1/asintegration-jmx/src/main/java/org/jboss/aop/deployment/AspectManagerService.java 2009-09-30 13:29:07 UTC (rev 94155)
@@ -23,6 +23,8 @@
import java.util.concurrent.atomic.AtomicLong;
+import javax.management.JMException;
+import javax.management.ListenerNotFoundException;
import javax.management.Notification;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
@@ -59,6 +61,36 @@
sendNotification(msg);
}
+ public void addNotificationListener(NotificationListener listener,
+ NotificationFilter filter,
+ Object handback)
+ {
+ try
+ {
+ registry.add(listener, filter, handback);
+ }
+ catch (JMException e)
+ {
+ // This shouldn't happen?
+ throw new RuntimeException(e.toString());
+ }
+ }
+
+ public void removeNotificationListener(NotificationListener listener)
+ throws ListenerNotFoundException
+ {
+ registry.remove(listener);
+ }
+
+ public void removeNotificationListener(NotificationListener listener,
+ NotificationFilter filter,
+ Object handback)
+ throws ListenerNotFoundException
+ {
+ registry.remove(listener, filter, handback);
+ }
+
+
public void sendNotification(Notification notification)
{
ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
@@ -73,6 +105,7 @@
}
}
+
/**
* Handle the notification, the default implementation is to synchronously invoke the listener.
*
More information about the jboss-cvs-commits
mailing list