public abstract class NotificationListenerBase extends Object implements NotificationListener
Caller should call cleanup() when done, because
a listener is maintained on the MBeanServer delegate.
| Modifier | Constructor and Description |
|---|---|
protected |
NotificationListenerBase(String name,
MBeanServerConnection conn,
ObjectName pattern)
Calls this( conn, listenTo, null, null ).
|
protected |
NotificationListenerBase(String name,
MBeanServerConnection conn,
ObjectName pattern,
NotificationFilter filter)
Listen to all MBean(s) which match the pattern 'listenTo'.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAlive() |
void |
cleanup()
Reset everything so that no listening is occuring and
all lists are empty.
|
protected MBeanServerConnection |
getConn() |
Set<ObjectName> |
getListenees() |
MBeanServerConnection |
getMBeanServerConnection() |
NotificationFilter |
getNotificationFilter(ObjectName objectName)
Get the filter originally specified when constructing this object.
|
boolean |
isAlive() |
protected void |
listenToIfMatch(ObjectName objectName) |
protected void |
listenToMBean(ObjectName objectName) |
void |
startListening() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleNotificationprotected NotificationListenerBase(String name, MBeanServerConnection conn, ObjectName pattern) throws IOException
Instantiating code must call setupListening() in order to initiate listening
IOExceptionprotected NotificationListenerBase(String name, MBeanServerConnection conn, ObjectName pattern, NotificationFilter filter) throws IOException
Instantiating code must call setupListening() in order to initiate listening
name - arbitrary name of this listenerconn - the MBeanServerConnection or MBeanServerpattern - an MBean ObjectName, or an ObjectName patternfilter - optional NotificationFilterIOExceptionprotected void listenToMBean(ObjectName objectName) throws InstanceNotFoundException, IOException
InstanceNotFoundExceptionIOExceptionpublic void startListening()
throws InstanceNotFoundException,
IOException
InstanceNotFoundExceptionIOExceptionpublic final NotificationFilter getNotificationFilter(ObjectName objectName)
protected void listenToIfMatch(ObjectName objectName) throws IOException, InstanceNotFoundException
IOExceptionInstanceNotFoundExceptionpublic void cleanup()
public Set<ObjectName> getListenees()
public final MBeanServerConnection getMBeanServerConnection()
an - Exception if no longer alive ( isAlive() returns false).protected final MBeanServerConnection getConn()
protected final void checkAlive()
throws IOException
IOExceptionpublic boolean isAlive()
Copyright © 2019. All rights reserved.