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 methods that a listener interested in namespace changes
30 * must implement.
31 * Specifically, the listener is interested in <tt>NamingEvent</tt>s
32 * with event types of <tt>OBJECT_ADDED</TT>, <TT>OBJECT_RENAMED</TT>, or
33 * <TT>OBJECT_REMOVED</TT>.
34 *<p>
35 * Such a listener must:
36 *<ol>
37 *<li>Implement this interface and its methods.
38 *<li>Implement <tt>NamingListener.namingExceptionThrown()</tt> so that
39 * it will be notified of exceptions thrown while attempting to
40 * collect information about the events.
41 *<li>Register with the source using the source's <tt>addNamingListener()</tt>
42 * method.
43 *</ol>
44 * A listener that wants to be notified of <tt>OBJECT_CHANGED</tt> event types
45 * should also implement the <tt>ObjectChangeListener</tt>
46 * interface.
47 *
48 * @author Rosanna Lee
49 * @author Scott Seligman
50 * @version 1.14 07/05/05
51 *
52 * @see NamingEvent
53 * @see ObjectChangeListener
54 * @see EventContext
55 * @see EventDirContext
56 * @since 1.3
57 */
58 public interface NamespaceChangeListener extends NamingListener {
59
60 /**
61 * Called when an object has been added.
62 *<p>
63 * The binding of the newly added object can be obtained using
64 * <tt>evt.getNewBinding()</tt>.
65 * @param evt The nonnull event.
66 * @see NamingEvent#OBJECT_ADDED
67 */
68 void objectAdded(NamingEvent evt);
69
70 /**
71 * Called when an object has been removed.
72 *<p>
73 * The binding of the newly removed object can be obtained using
74 * <tt>evt.getOldBinding()</tt>.
75 * @param evt The nonnull event.
76 * @see NamingEvent#OBJECT_REMOVED
77 */
78 void objectRemoved(NamingEvent evt);
79
80 /**
81 * Called when an object has been renamed.
82 *<p>
83 * The binding of the renamed object can be obtained using
84 * <tt>evt.getNewBinding()</tt>. Its old binding (before the rename)
85 * can be obtained using <tt>evt.getOldBinding()</tt>.
86 * One of these may be null if the old/new binding was outside the
87 * scope in which the listener has registered interest.
88 * @param evt The nonnull event.
89 * @see NamingEvent#OBJECT_RENAMED
90 */
91 void objectRenamed(NamingEvent evt);
92 }
|