KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > NotificationBroadcaster


1 /*
2  * @(#)NotificationBroadcaster.java 1.35 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8
9 package javax.management;
10
11
12 /**
13  * <p>Interface implemented by an MBean that emits Notifications. It
14  * allows a listener to be registered with the MBean as a notification
15  * listener.</p>
16  *
17  * <p>New code should use the {@link NotificationEmitter} interface
18  * instead.</p>
19  *
20  * @since 1.5
21  */

22 public interface NotificationBroadcaster {
23     
24     /**
25      * Adds a listener to this MBean.
26      *
27      * @param listener The listener object which will handle the
28      * notifications emitted by the broadcaster.
29      * @param filter The filter object. If filter is null, no
30      * filtering will be performed before handling notifications.
31      * @param handback An opaque object to be sent back to the
32      * listener when a notification is emitted. This object cannot be
33      * used by the Notification broadcaster object. It should be
34      * resent unchanged with the notification to the listener.
35      *
36      * @exception IllegalArgumentException Listener parameter is null.
37      *
38      * @see #removeNotificationListener
39      */

40     public void addNotificationListener(NotificationListener JavaDoc listener,
41                     NotificationFilter JavaDoc filter,
42                     Object JavaDoc handback)
43         throws java.lang.IllegalArgumentException JavaDoc;
44     
45     /**
46      * Removes a listener from this MBean. If the listener
47      * has been registered with different handback objects or
48      * notification filters, all entries corresponding to the listener
49      * will be removed.
50      *
51      * @param listener A listener that was previously added to this
52      * MBean.
53      *
54      * @exception ListenerNotFoundException The listener is not
55      * registered with the MBean.
56      *
57      * @see #addNotificationListener
58      * @see NotificationEmitter#removeNotificationListener
59      */

60     public void removeNotificationListener(NotificationListener JavaDoc listener)
61         throws ListenerNotFoundException JavaDoc;
62     
63     /**
64      * <p>Returns an array indicating, for each notification this
65      * MBean may send, the name of the Java class of the notification
66      * and the notification type.</p>
67      *
68      * <p>It is not illegal for the MBean to send notifications not
69      * described in this array. However, some clients of the MBean
70      * server may depend on the array being complete for their correct
71      * functioning.</p>
72      *
73      * @return the array of possible notifications.
74      */

75     public MBeanNotificationInfo JavaDoc[] getNotificationInfo();
76 }
77
Popular Tags