1. /*
  2. * @(#)ObjectChangeListener.java 1.6 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.naming.event;
  8. /**
  9. * Specifies the method that a listener of a <tt>NamingEvent</tt>
  10. * with event type of <tt>OBJECT_CHANGED</tt> must implement.
  11. *<p>
  12. * An <tt>OBJECT_CHANGED</tt> event type is fired when (the contents of)
  13. * an object has changed. This might mean that its attributes have been modified,
  14. * added, or removed, and/or that the object itself has been replaced.
  15. * How the object has changed can be determined by examining the
  16. * <tt>NamingEvent</tt>'s old and new bindings.
  17. *<p>
  18. * A listener interested in <tt>OBJECT_CHANGED</tt> event types must:
  19. *<ol>
  20. *
  21. *<li>Implement this interface and its method (<tt>objectChanged()</tt>)
  22. *<li>Implement <tt>NamingListener.namingExceptionThrown()</tt> so that
  23. * it will be notified of exceptions thrown while attempting to
  24. * collect information about the events.
  25. *<li>Register with the source using the source's <tt>addNamingListener()</tt>
  26. * method.
  27. *</ol>
  28. * A listener that wants to be notified of namespace change events
  29. * should also implement the <tt>NamespaceChangeListener</tt>
  30. * interface.
  31. *
  32. * @author Rosanna Lee
  33. * @author Scott Seligman
  34. * @version 1.6 03/01/23
  35. *
  36. * @see NamingEvent
  37. * @see NamespaceChangeListener
  38. * @see EventContext
  39. * @see EventDirContext
  40. * @since 1.3
  41. */
  42. public interface ObjectChangeListener extends NamingListener {
  43. /**
  44. * Called when an object has been changed.
  45. *<p>
  46. * The binding of the changed object can be obtained using
  47. * <tt>evt.getNewBinding()</tt>. Its old binding (before the change)
  48. * can be obtained using <tt>evt.getOldBinding()</tt>.
  49. * @param evt The nonnull naming event.
  50. * @see NamingEvent#OBJECT_CHANGED
  51. */
  52. void objectChanged(NamingEvent evt);
  53. }