|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.appserv.management.util.jmx.NotificationListenerBase
public abstract class NotificationListenerBase
Convenience base class for listening for Notifications from one or more MBeans, which may be specified as a specific MBean ObjectName, or an ObjectName pattern. If the ObjectName is a pattern, the list of listenees is dynamically maintained.
Caller should call cleanup()
when done, because
a listener is maintained on the MBeanServer delegate.
Constructor Summary | |
---|---|
NotificationListenerBase(MBeanServerConnection conn,
ObjectName pattern)
Calls this( conn, listenTo, null, null ). |
|
NotificationListenerBase(MBeanServerConnection conn,
ObjectName pattern,
NotificationFilter filter)
Listen to all MBean(s) which match the pattern 'listenTo' |
Method Summary | |
---|---|
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. |
abstract void |
handleNotification(Notification notif,
Object handback)
Subclass should implement this routine. |
boolean |
isAlive()
|
protected void |
listenToIfMatch(ObjectName objectName)
|
protected void |
listenToMBean(ObjectName objectName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NotificationListenerBase(MBeanServerConnection conn, ObjectName pattern) throws InstanceNotFoundException, IOException
InstanceNotFoundException
IOException
public NotificationListenerBase(MBeanServerConnection conn, ObjectName pattern, NotificationFilter filter) throws InstanceNotFoundException, IOException
conn
- the MBeanServerConnection or MBeanServerpattern
- an MBean ObjectName, or an ObjectName patternfilter
- optional NotificationFilter
InstanceNotFoundException
IOException
Method Detail |
---|
public abstract void handleNotification(Notification notif, Object handback)
handleNotification
in interface NotificationListener
protected void listenToMBean(ObjectName objectName) throws InstanceNotFoundException, IOException
InstanceNotFoundException
IOException
public final NotificationFilter getNotificationFilter(ObjectName objectName)
protected void listenToIfMatch(ObjectName objectName) throws IOException, InstanceNotFoundException
IOException
InstanceNotFoundException
public 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
IOException
public boolean isAlive()
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.