Package org.apache.commons.modeler
Class BaseNotificationBroadcaster
java.lang.Object
org.apache.commons.modeler.BaseNotificationBroadcaster
- All Implemented Interfaces:
NotificationBroadcaster
Implementation of NotificationBroadcaster
for attribute
change notifications. This class is used by BaseModelMBean
to
handle notifications of attribute change events to interested listeners.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayList
The set of registeredBaseNotificationBroadcasterEntry
entries.(package private) int[]
(package private) NotificationListener[][]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Add a notification event listener to this MBean.Return anMBeanNotificationInfo
object describing the notifications sent by this MBean.private void
void
Remove a notification event listener from this MBean.void
removeNotificationListener
(NotificationListener listener, Object handback) Remove a notification event listener from this MBean.void
removeNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Remove a notification event listener from this MBean.void
sendNotification
(Notification notification) Send the specified notification to all interested listeners.
-
Field Details
-
entries
The set of registeredBaseNotificationBroadcasterEntry
entries. -
hooks
NotificationListener[][] hooks -
hookCount
int[] hookCount
-
-
Constructor Details
-
BaseNotificationBroadcaster
public BaseNotificationBroadcaster()
-
-
Method Details
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException Add a notification event listener to this MBean.- Specified by:
addNotificationListener
in interfaceNotificationBroadcaster
- Parameters:
listener
- Listener that will receive event notificationsfilter
- Filter object used to filter event notifications actually delivered, ornull
for no filteringhandback
- Handback object to be sent along with event notifications- Throws:
IllegalArgumentException
- if the listener parameter is null
-
getNotificationInfo
Return anMBeanNotificationInfo
object describing the notifications sent by this MBean.- Specified by:
getNotificationInfo
in interfaceNotificationBroadcaster
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException Remove a notification event listener from this MBean.- Specified by:
removeNotificationListener
in 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
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener, Object handback) throws ListenerNotFoundException Remove a notification event listener from this MBean.- Parameters:
listener
- The listener to be removed (any and all registrations for this listener will be eliminated)handback
- Handback object to be sent along with event notifications- Throws:
ListenerNotFoundException
- if this listener is not registered in the MBean
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException Remove a notification event listener from this MBean.- Parameters:
listener
- The listener to be removed (any and all registrations for this listener will be eliminated)filter
- Filter object used to filter event notifications actually delivered, ornull
for no filteringhandback
- Handback object to be sent along with event notifications- Throws:
ListenerNotFoundException
- if this listener is not registered in the MBean
-
sendNotification
Send the specified notification to all interested listeners.- Parameters:
notification
- The notification to be sent
-
registerNotifications
-