2362N/A * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <p>Interface implemented by an MBean that emits Notifications. It 0N/A * allows a listener to be registered with the MBean as a notification 0N/A * <h3>Notification dispatch</h3> 0N/A * <p>When an MBean emits a notification, it considers each listener that has been 0N/A * added with {@link #addNotificationListener addNotificationListener} and not 0N/A * subsequently removed with {@link #removeNotificationListener removeNotificationListener}. 0N/A * If a filter was provided with that listener, and if the filter's 0N/A * {@link NotificationFilter#isNotificationEnabled isNotificationEnabled} method returns 0N/A * false, the listener is ignored. Otherwise, the listener's 0N/A * {@link NotificationListener#handleNotification handleNotification} method is called with 0N/A * the notification, as well as the handback object that was provided to 0N/A * {@code addNotificationListener}.</p> 0N/A * <p>If the same listener is added more than once, it is considered as many times as it was 0N/A * added. It is often useful to add the same listener with different filters or handback 0N/A * <p>Implementations of this interface can differ regarding the thread in which the methods 0N/A * of filters and listeners are called.</p> 0N/A * <p>If the method call of a filter or listener throws an {@link Exception}, then that 0N/A * exception should not prevent other listeners from being invoked. However, if the method 0N/A * call throws an {@link Error}, then it is recommended that processing of the notification 0N/A * stop at that point, and if it is possible to propagate the {@code Error} to the sender of 0N/A * the notification, this should be done.</p> 0N/A * <p>New code should use the {@link NotificationEmitter} interface 0N/A * <p>Implementations of this interface and of {@code NotificationEmitter} 0N/A * should be careful about synchronization. In particular, it is not a good 0N/A * idea for an implementation to hold any locks while it is calling a 0N/A * listener. To deal with the possibility that the list of listeners might 0N/A * change while a notification is being dispatched, a good strategy is to 0N/A * use a {@link CopyOnWriteArrayList} for this list. * Adds a listener to this MBean. * @param listener The listener object which will handle the * notifications emitted by the broadcaster. * @param filter The filter object. If filter is null, no * filtering will be performed before handling notifications. * @param handback An opaque object to be sent back to the * listener when a notification is emitted. This object cannot be * used by the Notification broadcaster object. It should be * resent unchanged with the notification to the listener. * @exception IllegalArgumentException Listener parameter is null. * @see #removeNotificationListener * Removes a listener from this MBean. If the listener * has been registered with different handback objects or * notification filters, all entries corresponding to the listener * @param listener A listener that was previously added to this * @exception ListenerNotFoundException The listener is not * registered with the MBean. * @see #addNotificationListener * @see NotificationEmitter#removeNotificationListener * <p>Returns an array indicating, for each notification this * MBean may send, the name of the Java class of the notification * and the notification type.</p> * <p>It is not illegal for the MBean to send notifications not * described in this array. However, some clients of the MBean * server may depend on the array being complete for their correct * @return the array of possible notifications.