|
Java™ Platform Standard Ed. 7 DRAFT ea-b76 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EventConsumer
This interface specifies methods to subscribe a listener to receive events from an MBean or a set of MBeans. The MBeans can already be registered in an MBean server, or they can be pending registration, or they can be MBeans that will never be registered, or they can be MBeans that will be registered then unregistered.
| Modifier and Type | Method and Description |
|---|---|
void |
subscribe(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Subscribes a listener to receive events from an MBean or a set of MBeans represented by an ObjectName pattern. |
void |
unsubscribe(ObjectName name,
NotificationListener listener)
Unsubscribes a listener which is listening to an MBean or a set of MBeans represented by an ObjectName pattern. |
| Method Detail |
|---|
void subscribe(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IOException
Subscribes a listener to receive events from an MBean or a set
of MBeans represented by an ObjectName pattern.
An event emitted by an MBean is forwarded to every listener that was subscribed with the name of that MBean, or with a pattern that matches that name.
name - The name of an MBean or an ObjectName pattern
representing a set of MBeans to which the listener should listen.listener - The listener object that will handle the
notifications emitted by the MBeans.filter - The filter object. If filter is null, no
filtering will be performed before notification handling.handback - The context to be sent to the listener when a
notification is emitted.IllegalArgumentException - If the name or
listener is null.IOException - for a remote client, thrown if
an I/O error occurs.unsubscribe(ObjectName, NotificationListener)
void unsubscribe(ObjectName name,
NotificationListener listener)
throws ListenerNotFoundException,
IOException
Unsubscribes a listener which is listening to an MBean or a set of
MBeans represented by an ObjectName pattern.
The listener to be removed must have been added by the subscribe method with the given name. If the name is a pattern, then the subscribe must have used the same
pattern. If the same listener has been subscribed more than once to the
name, perhaps with different filters or handbacks, then all such
listeners are removed.
name - The name of the MBean or an ObjectName pattern
representing a set of MBeans to which the listener was subscribed.listener - A listener that was previously subscribed to the
MBean(s).ListenerNotFoundException - The given listener was not
subscribed to the given name.IOException - for a remote client, thrown if
an I/O error occurs.subscribe(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
|
Java™ Platform Standard Ed. 7 DRAFT ea-b76 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.