| java.lang.Object javax.management.NotificationBroadcasterSupport
All known Subclasses: javax.management.timer.Timer, mx4j.remote.ConnectionNotificationEmitter, mx4j.log.LoggerBroadcaster, javax.management.remote.JMXConnectorServer, javax.management.monitor.Monitor, javax.management.relation.RelationService,
NotificationBroadcasterSupport | public class NotificationBroadcasterSupport implements NotificationEmitter(Code) | | 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:
- Applications should not assume a synchronous model. When the 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()).
- Applications should not assume an asynchronous model.
If the actions performed by a listener are potentially slow, the listener should arrange for them to be performed
in another thread, to avoid holding up other listeners and the caller of sendNotification.
version: $Revision: 1.19 $ |
NotificationBroadcasterSupport | public NotificationBroadcasterSupport()(Code) | | |
handleNotification | protected void handleNotification(NotificationListener listener, Notification notification, Object handback)(Code) | | This method is called by
NotificationBroadcasterSupport.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);
Parameters: listener - - the listener to which the notification is being delivered. Parameters: notification - - the notification being delivered to the listener. Parameters: handback - - the handback object that was supplied when the listener was added. since: JMX 1.2 |
sendNotification | public void sendNotification(Notification notification)(Code) | | Sends the given notification to all registered listeners
Parameters: notification - The notification to send |
|
|