org.apache.commons.modeler

Class BaseNotificationBroadcaster

Implemented Interfaces:
NotificationBroadcaster

public class BaseNotificationBroadcaster
extends java.lang.Object
implements NotificationBroadcaster

Implementation of NotificationBroadcaster for attribute change notifications. This class is used by BaseModelMBean to handle notifications of attribute change events to interested listeners.
Authors:
Craig R. McClanahan
Costin Manolache

Field Summary

protected ArrayList
entries
The set of registered BaseNotificationBroadcasterEntry entries.
(package private) int[]
hookCount
(package private) NotificationListener[][]
hooks

Method Summary

void
addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
Add a notification event listener to this MBean.
MBeanNotificationInfo[]
getNotificationInfo()
Return an MBeanNotificationInfo object describing the notifications sent by this MBean.
private void
registerNotifications(FixedNotificationFilter filter)
void
removeNotificationListener(NotificationListener listener)
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
removeNotificationListener(NotificationListener listener, 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

protected ArrayList entries
The set of registered BaseNotificationBroadcasterEntry entries.

hookCount

(package private)  int[] hookCount

hooks

(package private)  NotificationListener[][] hooks

Method Details

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
            throws IllegalArgumentException
Add a notification event listener to this MBean.
Parameters:
listener - Listener that will receive event notifications
filter - Filter object used to filter event notifications actually delivered, or null for no filtering
handback - Handback object to be sent along with event notifications

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Return an MBeanNotificationInfo object describing the notifications sent by this MBean.

registerNotifications

private void registerNotifications(FixedNotificationFilter filter)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
            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)

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, or null for no filtering
handback - Handback object to be sent along with event notifications

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

sendNotification

public void sendNotification(Notification notification)
Send the specified notification to all interested listeners.
Parameters:
notification - The notification to be sent

Copyright (c) 2001-2003 - Apache Software Foundation