| java.lang.Object java.util.EventObject javax.naming.event.NamingEvent
NamingEvent | public class NamingEvent extends EventObject (Code) | | An event from a directory or naming service, for passing to a listener.
The source of the event is always the EventContext that the
listener registered with. Names in the NamingEvent object are
all relative to this context.
Note the discussion about threads and synchronization in the description for
this package.
|
Field Summary | |
final public static int | OBJECT_ADDED A NamingEvent type constant, indicating that an object was
added. | final public static int | OBJECT_CHANGED A NamingEvent type constant, indicating that an object was
changed. | final public static int | OBJECT_REMOVED A NamingEvent type constant, indicating that an object was
removed. | final public static int | OBJECT_RENAMED A NamingEvent type constant, indicating that an object was
renamed. | protected Object | changeInfo Some information about the event, whose format is specified by the
service provider. | protected Binding | newBinding The binding after the event. | protected Binding | oldBinding The binding before the event. | protected int | type The type of this event. |
Constructor Summary | |
public | NamingEvent(EventContext eventContext, int type, Binding newBinding, Binding oldBinding, Object changeInfo) Constructs an NamingEvent with all parameters.
Parameters: eventContext - the context that generated this event. |
Method Summary | |
public void | dispatch(NamingListener naminglistener) Calls a method to notify the listener of this event.
For OBJECT_ADDED , OBJECT_REMOVED or
OBJECT_RENAMED type events this method calls the
corresponding method in the NamespaceChangedListener
interface. | public Object | getChangeInfo() Gets the change information. | public EventContext | getEventContext() Gets the EventContext that generated this event. | public Binding | getNewBinding() Gets the binding after this event.
If it exists and is inside the scope that was specified when the listener
was registered using EventContext.addNamingListener .
Returns null otherwise. | public Binding | getOldBinding() Gets the binding before this event.
If it existed and was inside the scope that was specified when the
listener was registered using EventContext.addNamingListener .
Returns null otherwise. | public int | getType() Gets the type of the event. |
OBJECT_ADDED | final public static int OBJECT_ADDED(Code) | | A NamingEvent type constant, indicating that an object was
added.
|
OBJECT_CHANGED | final public static int OBJECT_CHANGED(Code) | | A NamingEvent type constant, indicating that an object was
changed.
|
OBJECT_REMOVED | final public static int OBJECT_REMOVED(Code) | | A NamingEvent type constant, indicating that an object was
removed.
|
OBJECT_RENAMED | final public static int OBJECT_RENAMED(Code) | | A NamingEvent type constant, indicating that an object was
renamed.
|
changeInfo | protected Object changeInfo(Code) | | Some information about the event, whose format is specified by the
service provider.
|
newBinding | protected Binding newBinding(Code) | | The binding after the event.
|
oldBinding | protected Binding oldBinding(Code) | | The binding before the event.
|
type | protected int type(Code) | | The type of this event. Its value is one of the constant event types
above.
|
NamingEvent | public NamingEvent(EventContext eventContext, int type, Binding newBinding, Binding oldBinding, Object changeInfo)(Code) | | Constructs an NamingEvent with all parameters.
Parameters: eventContext - the context that generated this event. It is the originator ofthis event and cannot be null. Parameters: type - the constant value that specifies the type of event Parameters: newBinding - binding after the event. newBinding might benull depending on the value of the type parameter as follows:-
OBJECT_ADDED - newBinding cannot be null -
OBJECT_CHANGED - newBinding cannot be null -
OBJECT_REMOVED - newBinding can be null -
OBJECT_RENAMED - newBinding can be null The names are relative to the eventContext Parameters: oldBinding - the binding before the event. oldBinding mightbe null depending on the value of the type parameter as follows:-
OBJECT_ADDED - oldBinding can be null -
OBJECT_CHANGED - oldBinding cannot be null -
OBJECT_REMOVED - oldBinding cannot be null -
OBJECT_RENAMED - oldBinding can be null The names are relative to the eventContext Parameters: changeInfo - contain some information about the event and maybe null, theformat of which is specified by the service provider. |
dispatch | public void dispatch(NamingListener naminglistener)(Code) | | Calls a method to notify the listener of this event.
For OBJECT_ADDED , OBJECT_REMOVED or
OBJECT_RENAMED type events this method calls the
corresponding method in the NamespaceChangedListener
interface. For OBJECT_CHANGED type events this method
calls objectChanged() in the
ObjectChangeListener interface.
Parameters: naminglistener - the listener of this event |
getChangeInfo | public Object getChangeInfo()(Code) | | Gets the change information.
the change information object provided by the service provider,which may be null. |
getEventContext | public EventContext getEventContext()(Code) | | Gets the EventContext that generated this event.
the EventContext that generated this event. |
getNewBinding | public Binding getNewBinding()(Code) | | Gets the binding after this event.
If it exists and is inside the scope that was specified when the listener
was registered using EventContext.addNamingListener .
Returns null otherwise. Therefore for an OBJECT_RENAMED
event, the return value will be non-null if the new name places the
binding within the scope for the listener.
the binding after this event |
getOldBinding | public Binding getOldBinding()(Code) | | Gets the binding before this event.
If it existed and was inside the scope that was specified when the
listener was registered using EventContext.addNamingListener .
Returns null otherwise. Therefore for an OBJECT_RENAMED
event, the return value will be non-null if the old name placed the
binding within the scope for the listener.
the binding before this event |
getType | public int getType()(Code) | | Gets the type of the event.
The return value is constrained to a choice from:
OBJECT_ADDED , OBJECT_REMOVED ,
OBJECT_RENAMED , OBJECT_CHANGED .
the type of the event |
|
|