1 /* 2 * @(#)NamingListener.java 1.7 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 package javax.naming.event; 9 10 /** 11 * This interface is the root of listener interfaces that 12 * handle <tt>NamingEvent</tt>s. 13 * It does not make sense for a listener to implement just this interface. 14 * A listener typically implements a subinterface of <tt>NamingListener</tt>, 15 * such as <tt>ObjectChangeListener</tt> or <tt>NamespaceChangeListener</tt>. 16 *<p> 17 * This interface contains a single method, <tt>namingExceptionThrown()</tt>, 18 * that must be implemented so that the listener can be notified of 19 * exceptions that are thrown (by the service provider) while gathering 20 * information about the events that they're interested in. 21 * When this method is invoked, the listener has been automatically deregistered 22 * from the <tt>EventContext</tt> with which it has registered. 23 *<p> 24 * For example, suppose a listener implements <tt>ObjectChangeListener</tt> and 25 * registers with a <tt>EventContext</tt>. 26 * Then, if the connection to the server is subsequently broken, 27 * the listener will receive a <tt>NamingExceptionEvent</tt> and may 28 * take some corrective action, such as notifying the user of the application. 29 * 30 * @author Rosanna Lee 31 * @author Scott Seligman 32 * @version 1.7 03/12/19 33 * 34 * @see NamingEvent 35 * @see NamingExceptionEvent 36 * @see EventContext 37 * @see EventDirContext 38 * @since 1.3 39 */ 40 public interface NamingListener extends java.util.EventListener { 41 /** 42 * Called when a naming exception is thrown while attempting 43 * to fire a <tt>NamingEvent</tt>. 44 * 45 * @param evt The nonnull event. 46 */ 47 void namingExceptionThrown(NamingExceptionEvent evt); 48 } 49