Package org.glassfish.admin.amx.util.jmx
Class MBeanRegistrationListener
- java.lang.Object
-
- org.glassfish.admin.amx.util.jmx.NotificationListenerBase
-
- org.glassfish.admin.amx.util.jmx.MBeanRegistrationListener
-
- All Implemented Interfaces:
EventListener,NotificationListener
public abstract class MBeanRegistrationListener extends NotificationListenerBase
Convenience base class for listening toMBeanServerNotificationnotifications. A class extending this class must implementmbeanRegistered(javax.management.ObjectName)andmbeanUnregistered(javax.management.ObjectName).The class is designed to start listening upon creation. The caller should call cleanup() when listening is no longer desired. Once cleanup() is called, no further listening can be done; a new MBeanRegistrationListener should be instantiated if further listening is desired.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMBeanRegistrationListener(String name, MBeanServerConnection conn)Calls this( conn, null ).protectedMBeanRegistrationListener(String name, MBeanServerConnection conn, ObjectName constrain)If 'constrain' is non-null, then all registration and unregistration events will be filtered through it.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidhandleNotification(Notification notifIn, Object handback)protected abstract voidmbeanRegistered(ObjectName objectName)protected abstract voidmbeanUnregistered(ObjectName objectName)-
Methods inherited from class org.glassfish.admin.amx.util.jmx.NotificationListenerBase
checkAlive, cleanup, getConn, getListenees, getMBeanServerConnection, getNotificationFilter, isAlive, listenToIfMatch, listenToMBean, startListening
-
-
-
-
Constructor Detail
-
MBeanRegistrationListener
protected MBeanRegistrationListener(String name, MBeanServerConnection conn, ObjectName constrain) throws IOException
If 'constrain' is non-null, then all registration and unregistration events will be filtered through it. Only those MBeans matching will be passed through tombeanRegistered(javax.management.ObjectName)andmbeanUnregistered(javax.management.ObjectName).- Parameters:
conn-constrain- optional fixed or pattern ObjectName- Throws:
IOException
-
MBeanRegistrationListener
protected MBeanRegistrationListener(String name, MBeanServerConnection conn) throws IOException
Calls this( conn, null ).- Parameters:
conn-- Throws:
IOException
-
-
Method Detail
-
mbeanRegistered
protected abstract void mbeanRegistered(ObjectName objectName)
-
mbeanUnregistered
protected abstract void mbeanUnregistered(ObjectName objectName)
-
handleNotification
public void handleNotification(Notification notifIn, Object handback)
-
-