Package org.apache.tomcat.util.modeler
Class BaseNotificationBroadcaster
- java.lang.Object
-
- org.apache.tomcat.util.modeler.BaseNotificationBroadcaster
-
- All Implemented Interfaces:
NotificationBroadcaster
public class BaseNotificationBroadcaster extends Object implements NotificationBroadcaster
Implementation of
NotificationBroadcasterfor attribute change notifications. This class is used byBaseModelMBeanto handle notifications of attribute change events to interested listeners.- Author:
- Craig R. McClanahan, Costin Manolache
-
-
Constructor Summary
Constructors Constructor Description BaseNotificationBroadcaster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)Add a notification event listener to this MBean.MBeanNotificationInfo[]getNotificationInfo()Return anMBeanNotificationInfoobject describing the notifications sent by this MBean.voidremoveNotificationListener(NotificationListener listener)Remove a notification event listener from this MBean.voidsendNotification(Notification notification)Send the specified notification to all interested listeners.
-
-
-
Field Detail
-
entries
protected ArrayList<org.apache.tomcat.util.modeler.BaseNotificationBroadcasterEntry> entries
The set of registeredBaseNotificationBroadcasterEntryentries.
-
-
Method Detail
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
Add a notification event listener to this MBean.- Specified by:
addNotificationListenerin interfaceNotificationBroadcaster- Parameters:
listener- Listener that will receive event notificationsfilter- Filter object used to filter event notifications actually delivered, ornullfor no filteringhandback- Handback object to be sent along with event notifications- Throws:
IllegalArgumentException- if the listener parameter is null
-
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
Return anMBeanNotificationInfoobject describing the notifications sent by this MBean.- Specified by:
getNotificationInfoin interfaceNotificationBroadcaster
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
Remove a notification event listener from this MBean.- Specified by:
removeNotificationListenerin interfaceNotificationBroadcaster- Parameters:
listener- The listener to be removed (any and all registrations for this listener will be eliminated)- Throws:
ListenerNotFoundException- if this listener is not registered in the MBean
-
sendNotification
public void sendNotification(Notification notification)
Send the specified notification to all interested listeners.- Parameters:
notification- The notification to be sent
-
-