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