| javax.naming.event.EventContext
EventContext | public interface EventContext extends Context(Code) | | This interface is for registering and deregistering to receive events about
objects that are bound in a context.
Listeners register an interest in a target object or objects. The context
might not yet have a binding for the target, and it is optional whether a
context will support registering for events about an object that is not
bound. If the context does not support it then
addNamingListener() should throw a
NameNotFoundException . Alternatively, if this is not
possible, the EventContext should send the listener a
NamingExceptionEvent with the information. A
NamingExceptionEvent is also used to notify listeners who have
registered interest in a target that is subsequently deleted, if the context
only allows registration for currently bound objects.
Listeners can register for events affecting the context itself, which as
usual is referred to by the empty name.
When a listener receives a NamingExceptionEvent it is
deregistered.
When Context .closed is called on an EventContext ,
all of its listeners are deregistered.
Listener implementations may choose to implement more than one sub-interface
of NamingListener , in order to be notified of more than one
type of event.
Event context implementations are not expected to be thread safe.
|
Field Summary | |
final public static int | OBJECT_SCOPE This constant indicates interest in the named object only. | final public static int | ONELEVEL_SCOPE This constant indicates interest in objects bound in the named context,
but not the context itself. | final public static int | SUBTREE_SCOPE This constant indicates interest in the named object and its subtree.
When the named object is not a context, "subtree" here refers to the
subtree of the context that contains the bound object. |
Method Summary | |
void | addNamingListener(Name name, int i, NamingListener namingListener) Registers namingListener for events concerning
name , with scope i .
The scope must be one of OBJECT_SCOPE ,
NELEVEL_SCOPE , or SUBTREE_SCOPE .
When the scope is ONELEVEL_SCOPE , name
must be a context. | void | addNamingListener(String s, int i, NamingListener namingListener) Registers namingListener for events concerning name, with
scope i . | void | removeNamingListener(NamingListener namingListener) Removes all registrations for namingListener in this
EventContext . | boolean | targetMustExist() Checks if the implementation supports registration for names that are not
(yet) bound in this context. |
OBJECT_SCOPE | final public static int OBJECT_SCOPE(Code) | | This constant indicates interest in the named object only.
|
ONELEVEL_SCOPE | final public static int ONELEVEL_SCOPE(Code) | | This constant indicates interest in objects bound in the named context,
but not the context itself.
|
SUBTREE_SCOPE | final public static int SUBTREE_SCOPE(Code) | | This constant indicates interest in the named object and its subtree.
When the named object is not a context, "subtree" here refers to the
subtree of the context that contains the bound object. Where the named
object is itself a context, "subtree" refers to the subtree of the named
context.
|
addNamingListener | void addNamingListener(Name name, int i, NamingListener namingListener) throws NamingException(Code) | | Registers namingListener for events concerning
name , with scope i .
The scope must be one of OBJECT_SCOPE ,
NELEVEL_SCOPE , or SUBTREE_SCOPE .
When the scope is ONELEVEL_SCOPE , name
must be a context. Otherwise name can be a context or a
bound object.
Name is relative to this context.
Parameters: name - the concerning name Parameters: i - the scope Parameters: namingListener - the listener to be registered throws: NamingException - If any exception occured. |
removeNamingListener | void removeNamingListener(NamingListener namingListener) throws NamingException(Code) | | Removes all registrations for namingListener in this
EventContext . If there are no registrations this method
does nothing.
Parameters: namingListener - the listener to be unregistered throws: NamingException - If any exception occured. |
targetMustExist | boolean targetMustExist() throws NamingException(Code) | | Checks if the implementation supports registration for names that are not
(yet) bound in this context.
false if implementation supports this, otherwise true if theimplementation does not support this. throws: NamingException - If the support is not known. |
|
|