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