public final class ObjectRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
EVENT_KNOWN_ADDED
The event constant that is used to signal that a previously unknown
object with a well known object id has been registered at the object
registry.
|
static int |
EVENT_KNOWN_REMOVED
The event constant that is used to signal that a previously registered
object with a well known object id has been removed from the registry.
|
static int |
EVENT_OBJECT_ADDED
The event constant that is used to signal that a new local
object has been registered at the object registry.
|
static int |
EVENT_OBJECT_REMOVED
The event constant that is used to signal that a previously registered
object has been removed from the object registry.
|
Modifier and Type | Method and Description |
---|---|
void |
addObjectListener(int type,
IListener listener)
Adds an object listener for the specified event types.
|
ObjectID |
getIdentifier(IInvocationHandler handler)
Retrieves the id of a previously registered invocation handler.
|
IInvocationHandler |
getInvocationHandler(ObjectID id)
Retrieves an invocation handler for the specified id.
|
ObjectID[] |
getKnownIdentifiers()
Returns the well known services registered at this registry.
|
java.lang.Object |
getKnownReference(ObjectID id)
Retrieves a local reference for the specified id.
|
boolean |
isIdentifierRegistered(ObjectID id)
Determines whether the specified object has been registered.
|
ObjectID |
registerObject(IInvocationHandler handler)
Registers a new object that handles invocations.
|
void |
registerObject(ObjectID id,
IInvocationHandler handler,
java.lang.Object localReference)
Registers a well known object with the specified id.
|
IInvocationHandler |
removeObject(ObjectID id)
Removes the invocation handler with the specified identifier.
|
boolean |
removeObjectListener(int type,
IListener listener)
Removes a previously registered object listener from the set of listeners
that are registered for the specified types.
|
java.lang.String |
toString()
Returns a string representation of the internal data structures
of the object registry.
|
public static final int EVENT_OBJECT_ADDED
public static final int EVENT_OBJECT_REMOVED
public static final int EVENT_KNOWN_ADDED
public static final int EVENT_KNOWN_REMOVED
public boolean isIdentifierRegistered(ObjectID id)
id
- The id of the object to lookup.public IInvocationHandler getInvocationHandler(ObjectID id)
id
- The id of the object to lookup.public ObjectID getIdentifier(IInvocationHandler handler)
handler
- The handler to lookup.public java.lang.Object getKnownReference(ObjectID id)
id
- The id of the object to lookup.public ObjectID registerObject(IInvocationHandler handler)
handler
- The handler used to dispatch requests.public void registerObject(ObjectID id, IInvocationHandler handler, java.lang.Object localReference)
id
- The id of the well known object.handler
- The handler for the object with the specified id.localReference
- The local reference for the well known object.public IInvocationHandler removeObject(ObjectID id)
id
- The identifier of the invocation handler.public ObjectID[] getKnownIdentifiers()
public void addObjectListener(int type, IListener listener)
type
- The types of events to register. Multiple types can
be concatenated using a logical or.listener
- The object listener to add.public boolean removeObjectListener(int type, IListener listener)
type
- The types of events to register. Multiple types can
be concatenated using a logical or.listener
- The listener to remove.public java.lang.String toString()
toString
in class java.lang.Object