|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--javax.management.NotificationBroadcasterSupport
Provides an implementation of
NotificationEmitter interface.
This can be used as the super class of an MBean that sends notifications.
It is not specified whether the notification dispatch model is
synchronous or asynchronous. That is, when a thread calls
sendNotification, the
NotificationListener.handleNotification
method of each listener may be called within that thread
(a synchronous model) or within some other thread (an asynchronous model).
Applications should not depend on notification dispatch being synchronous or being asynchronous. Thus:
sendNotification method returns, it is not
guaranteed that every listener's
handleNotification method
has been called. It is not guaranteed either that a listener will see
notifications in the same order as they were generated. Listeners that
depend on order should use the sequence number of notifications to
determine their order (see Notification.getSequenceNumber()).
sendNotification.
| Field Summary | |
(package private) javax.management.NotificationBroadcasterSupport.ListenerInfo |
li
|
| Constructor Summary | |
NotificationBroadcasterSupport()
Creates a NotificationBraoadCasterSupport. |
|
| Method Summary | |
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
Enables a couple (listener,handback) for a registered MBean to be added. |
MBeanNotificationInfo[] |
getNotificationInfo()
Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent. |
protected void |
handleNotification(NotificationListener listener,
Notification notif,
java.lang.Object handback)
This method is called by sendNotification
for each listener in order to send the notification to that listener. |
(package private) void |
handleNotification(Notification notif,
javax.management.NotificationBroadcasterSupport.ListenerInfo listenerInfo)
This method is called by sendNotification
for each listener in order to send the notification to that listener. |
void |
removeNotificationListener(NotificationListener listener)
Enables a listener for an MBean to be removed. |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
Enables a listener for an MBean to be removed. |
void |
sendNotification(Notification notification)
Enables a MBean to send a notification. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
javax.management.NotificationBroadcasterSupport.ListenerInfo li
| Constructor Detail |
public NotificationBroadcasterSupport()
| Method Detail |
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
listener - The listener object which will handles notifications
emitted by the registered MBean.filter - The filter object. If not specified, no filtering will
be performed before handling notifications.handback - The context to be sent to the listener
when a notification is emitted.
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
listener - The listener object which will handles notifications
emitted by the registered MBean.
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
throws ListenerNotFoundException
listener - The listener object which will handles notifications
related detailsfilter - This is the filter object which will handles filter
related detailshandback - Using this object we are able to handle the handback
related details emitted by the registered MBean.public MBeanNotificationInfo[] getNotificationInfo()
public void sendNotification(Notification notification)
notif - - The notification to send.
protected void handleNotification(NotificationListener listener,
Notification notif,
java.lang.Object handback)
This method is called by sendNotification
for each listener in order to send the notification to that listener.
This method helps to deliver the notification in separate thread.
listener - the listener to which the notification is being delivered.notif - the notification being delivered to the listener.handback - the handback object that was supplied when
the listener was added.
void handleNotification(Notification notif,
javax.management.NotificationBroadcasterSupport.ListenerInfo listenerInfo)
This method is called by sendNotification
for each listener in order to send the notification to that listener.
It can be overridden in subclasses to change the behaviour of
notification delivery, for instance to deliver the notification in
a separate thread.
It is not guaranteed that this method is called by the same thread as
the one that called sendNotification.
The default implementation of this method is equivalent to
listener.handleNotification(notif, handback);
listenerInfo - the ListenerInfo object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||