01 /*
02 * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package javax.naming.event;
27
28 /**
29 * Specifies the method that a listener of a <tt>NamingEvent</tt>
30 * with event type of <tt>OBJECT_CHANGED</tt> must implement.
31 *<p>
32 * An <tt>OBJECT_CHANGED</tt> event type is fired when (the contents of)
33 * an object has changed. This might mean that its attributes have been modified,
34 * added, or removed, and/or that the object itself has been replaced.
35 * How the object has changed can be determined by examining the
36 * <tt>NamingEvent</tt>'s old and new bindings.
37 *<p>
38 * A listener interested in <tt>OBJECT_CHANGED</tt> event types must:
39 *<ol>
40 *
41 *<li>Implement this interface and its method (<tt>objectChanged()</tt>)
42 *<li>Implement <tt>NamingListener.namingExceptionThrown()</tt> so that
43 * it will be notified of exceptions thrown while attempting to
44 * collect information about the events.
45 *<li>Register with the source using the source's <tt>addNamingListener()</tt>
46 * method.
47 *</ol>
48 * A listener that wants to be notified of namespace change events
49 * should also implement the <tt>NamespaceChangeListener</tt>
50 * interface.
51 *
52 * @author Rosanna Lee
53 * @author Scott Seligman
54 * @version 1.14 07/05/05
55 *
56 * @see NamingEvent
57 * @see NamespaceChangeListener
58 * @see EventContext
59 * @see EventDirContext
60 * @since 1.3
61 */
62 public interface ObjectChangeListener extends NamingListener {
63
64 /**
65 * Called when an object has been changed.
66 *<p>
67 * The binding of the changed object can be obtained using
68 * <tt>evt.getNewBinding()</tt>. Its old binding (before the change)
69 * can be obtained using <tt>evt.getOldBinding()</tt>.
70 * @param evt The nonnull naming event.
71 * @see NamingEvent#OBJECT_CHANGED
72 */
73 void objectChanged(NamingEvent evt);
74 }
|