1. /*
  2. * @(#)NamespaceChangeListener.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. * Specifies the methods that a listener interested in namespace changes
  13. * must implement.
  14. * Specifically, the listener is interested in <tt>NamingEvent</tt>s
  15. * with event types of <tt>OBJECT_ADDED</TT>, <TT>OBJECT_RENAMED</TT>, or
  16. * <TT>OBJECT_REMOVED</TT>.
  17. *<p>
  18. * Such a listener must:
  19. *<ol>
  20. *<li>Implement this interface and its methods.
  21. *<li>Implement <tt>NamingListener.namingExceptionThrown()</tt> so that
  22. * it will be notified of exceptions thrown while attempting to
  23. * collect information about the events.
  24. *<li>Register with the source using the source's <tt>addNamingListener()</tt>
  25. * method.
  26. *</ol>
  27. * A listener that wants to be notified of <tt>OBJECT_CHANGED</tt> event types
  28. * should also implement the <tt>ObjectChangeListener</tt>
  29. * interface.
  30. *
  31. * @author Rosanna Lee
  32. * @author Scott Seligman
  33. * @version 1.4 00/02/02
  34. *
  35. * @see NamingEvent
  36. * @see ObjectChangeListener
  37. * @see EventContext
  38. * @see EventDirContext
  39. * @since 1.3
  40. */
  41. public interface NamespaceChangeListener extends NamingListener {
  42. /**
  43. * Called when an object has been added.
  44. *<p>
  45. * The binding of the newly added object can be obtained using
  46. * <tt>evt.getNewBinding()</tt>.
  47. * @param evt The nonnull event.
  48. * @see NamingEvent#OBJECT_ADDED
  49. */
  50. void objectAdded(NamingEvent evt);
  51. /**
  52. * Called when an object has been removed.
  53. *<p>
  54. * The binding of the newly removed object can be obtained using
  55. * <tt>evt.getOldBinding()</tt>.
  56. * @param evt The nonnull event.
  57. * @see NamingEvent#OBJECT_REMOVED
  58. */
  59. void objectRemoved(NamingEvent evt);
  60. /**
  61. * Called when an object has been renamed.
  62. *<p>
  63. * The binding of the renamed object can be obtained using
  64. * <tt>evt.getNewBinding()</tt>. Its old binding (before the rename)
  65. * can be obtained using <tt>evt.getOldBinding()</tt>.
  66. * One of these may be null if the old/new binding was outside the
  67. * scope in which the listener has registered interest.
  68. * @param evt The nonnull event.
  69. * @see NamingEvent#OBJECT_RENAMED
  70. */
  71. void objectRenamed(NamingEvent evt);
  72. }