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