01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package javax.management;
09:
10: /**
11: * Should be implemented by an MBean that emits Notifications. It allows a listener to
12: * be registered within the MBean as notification listener.
13: *
14: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
15: */
16:
17: public interface NotificationBroadcaster {
18:
19: /**
20: * Adds a listener to a registered MBean.
21: *
22: * @param listener The listener object which will handle the notifications emitted by the registered MBean.
23: * @param filter The filter object. If filter is null, no filtering will be performed before handling notifications.
24: * @param handback An opaque object to be sent back to the listener when a notification is emitted. This object
25: * cannot be used by the Notification broadcaster object. It should be resent unchanged with the notification
26: * to the listener.
27: *
28: * @exception IllegalArgumentException Listener parameter is null.
29: */
30: public void addNotificationListener(NotificationListener listener,
31: NotificationFilter filter, Object handback)
32: throws java.lang.IllegalArgumentException;
33:
34: /**
35: * Removes a listener from a registered MBean.
36: *
37: * @param listener The listener object which will handle the notifications emitted by the registered MBean.
38: * This method will remove all the information related to this listener.
39: *
40: * @exception ListenerNotFoundException The listener is not registered in the MBean.
41: */
42: public void removeNotificationListener(NotificationListener listener)
43: throws ListenerNotFoundException;
44:
45: /**
46: * Returns a NotificationInfo object contaning the name of the Java class of the notification
47: * and the notification types sent.
48: */
49: public MBeanNotificationInfo[] getNotificationInfo();
50:
51: }
|