Source Code Cross Referenced for NotificationBroadcaster.java in  » 6.0-JDK-Core » management » javax » management » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » management » javax.management 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1999-2005 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.management;
027
028        import java.util.concurrent.CopyOnWriteArrayList; // for Javadoc
029
030        /**
031         * <p>Interface implemented by an MBean that emits Notifications. It
032         * allows a listener to be registered with the MBean as a notification
033         * listener.</p>
034         *
035         * <h3>Notification dispatch</h3>
036         *
037         * <p>When an MBean emits a notification, it considers each listener that has been
038         * added with {@link #addNotificationListener addNotificationListener} and not
039         * subsequently removed with {@link #removeNotificationListener removeNotificationListener}.
040         * If a filter was provided with that listener, and if the filter's
041         * {@link NotificationFilter#isNotificationEnabled isNotificationEnabled} method returns
042         * false, the listener is ignored.  Otherwise, the listener's
043         * {@link NotificationListener#handleNotification handleNotification} method is called with
044         * the notification, as well as the handback object that was provided to
045         * {@code addNotificationListener}.</p>
046         *
047         * <p>If the same listener is added more than once, it is considered as many times as it was
048         * added.  It is often useful to add the same listener with different filters or handback
049         * objects.</p>
050         *
051         * <p>Implementations of this interface can differ regarding the thread in which the methods
052         * of filters and listeners are called.</p>
053         *
054         * <p>If the method call of a filter or listener throws an {@link Exception}, then that
055         * exception should not prevent other listeners from being invoked.  However, if the method
056         * call throws an {@link Error}, then it is recommended that processing of the notification
057         * stop at that point, and if it is possible to propagate the {@code Error} to the sender of
058         * the notification, this should be done.</p>
059         *
060         * <p>New code should use the {@link NotificationEmitter} interface
061         * instead.</p>
062         *
063         * <p>Implementations of this interface and of {@code NotificationEmitter}
064         * should be careful about synchronization.  In particular, it is not a good
065         * idea for an implementation to hold any locks while it is calling a
066         * listener.  To deal with the possibility that the list of listeners might
067         * change while a notification is being dispatched, a good strategy is to
068         * use a {@link CopyOnWriteArrayList} for this list.
069         *
070         * @since 1.5
071         */
072        public interface NotificationBroadcaster {
073
074            /**
075             * Adds a listener to this MBean.
076             *
077             * @param listener The listener object which will handle the
078             * notifications emitted by the broadcaster.
079             * @param filter The filter object. If filter is null, no
080             * filtering will be performed before handling notifications.
081             * @param handback An opaque object to be sent back to the
082             * listener when a notification is emitted. This object cannot be
083             * used by the Notification broadcaster object. It should be
084             * resent unchanged with the notification to the listener.
085             *
086             * @exception IllegalArgumentException Listener parameter is null.
087             *
088             * @see #removeNotificationListener
089             */
090            public void addNotificationListener(NotificationListener listener,
091                    NotificationFilter filter, Object handback)
092                    throws java.lang.IllegalArgumentException;
093
094            /**
095             * Removes a listener from this MBean.  If the listener
096             * has been registered with different handback objects or
097             * notification filters, all entries corresponding to the listener
098             * will be removed.
099             *
100             * @param listener A listener that was previously added to this
101             * MBean.
102             *
103             * @exception ListenerNotFoundException The listener is not
104             * registered with the MBean.
105             *
106             * @see #addNotificationListener
107             * @see NotificationEmitter#removeNotificationListener
108             */
109            public void removeNotificationListener(NotificationListener listener)
110                    throws ListenerNotFoundException;
111
112            /**
113             * <p>Returns an array indicating, for each notification this
114             * MBean may send, the name of the Java class of the notification
115             * and the notification type.</p>
116             *
117             * <p>It is not illegal for the MBean to send notifications not
118             * described in this array.  However, some clients of the MBean
119             * server may depend on the array being complete for their correct
120             * functioning.</p>
121             *
122             * @return the array of possible notifications.
123             */
124            public MBeanNotificationInfo[] getNotificationInfo();
125        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.