javax.management
Class NotificationBroadcasterSupport
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
- Direct Known Subclasses:
- Monitor, RelationService, Timer
- public class NotificationBroadcasterSupport
- extends java.lang.Object
- implements NotificationBroadcaster
Provides an implementation of NotificationBroadcaster
interface.
It could be used as a super class of MBean to deal with notifications.
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NotificationBroadcasterSupport
public NotificationBroadcasterSupport()
addNotificationListener
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
- Adds a listener to a registered MBean.
- Specified by:
- addNotificationListener in interface NotificationBroadcaster
- Parameters:
listener
- The listener object which will handle the notifications emitted by the registered MBean.filter
- The filter object. If filter is null, no filtering will be performed before handling notifications.handback
- An opaque object to be sent back to the listener when a notification is emitted. This object
cannot be used by the Notification broadcaster object. It should be resent unchanged with the notification
to the listener.- Throws:
- java.lang.IllegalArgumentException - Listener parameter is null.
removeNotificationListener
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
- Removes a listener from a registered MBean.
- Specified by:
- removeNotificationListener in interface NotificationBroadcaster
- Parameters:
name
- The name of the MBean on which the listener should be removed.listener
- The listener object which will handle the notifications emitted by the registered MBean.
This method will remove all the information related to this listener.- Throws:
- ListenerNotFoundException - The listener is not registered in the MBean.
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
- Returns a NotificationInfo object contaning the name of the Java class of the notification
and the notification types sent.
- Specified by:
- getNotificationInfo in interface NotificationBroadcaster
sendNotification
public void sendNotification(Notification notification)
- Enables an MBean to send a notification.
- Parameters:
notification
- The notification to send.