Class DefaultRegistry
java.lang.Object
org.tentackle.trip.impl.DefaultRegistry
- All Implemented Interfaces:
Registry, Remote, RemoteLookup
-
Field Summary
Fields inherited from interface Registry
REGISTRY_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends Remote>
RemoteDelegate<T> createRemoteDelegate(UUID remoteId, T remoteObject, IndexedMethodCache methodCache) Creates a newRemoteDelegate.Looks up the unique ID of a remote delegate by its symbolic name.<T extends Remote>
RemoteDelegate<T> Looks up a remote delegate by its unique ID.Looks up the unique ID of a remote object.
Locates the remote delegate of a remote object and returns its unique ID.<T extends Remote>
RemoteDelegate<T> register(T remoteObject) Registers a remote object w/o a symbolic name.<T extends Remote>
RemoteDelegate<T> Registers a remote object with a symbolic name.<T extends Remote>
RemoteDelegate<T> unregister(String name) Unregisters a remote delegate by its symbolic name.<T extends Remote>
RemoteDelegate<T> unregister(UUID id) Unregisters a remote delegate by its unique ID.
-
Constructor Details
-
DefaultRegistry
public DefaultRegistry()Creates a new registry.
-
-
Method Details
-
register
Description copied from interface:RegistryRegisters a remote object with a symbolic name. -
register
Description copied from interface:RegistryRegisters a remote object w/o a symbolic name. -
unregister
Description copied from interface:RegistryUnregisters a remote delegate by its unique ID.- Specified by:
unregisterin interfaceRegistry- Type Parameters:
T- the type of the target object- Parameters:
id- the unique ID of the remote delegate to unregister- Returns:
- the remote delegate if found, null otherwise
-
unregister
Description copied from interface:RegistryUnregisters a remote delegate by its symbolic name.- Specified by:
unregisterin interfaceRegistry- Type Parameters:
T- the type of the target object- Parameters:
name- the symbolic name of the remote delegate to unregister- Returns:
- the remote delegate if found, null otherwise
-
lookup
Description copied from interface:RegistryLooks up a remote delegate by its unique ID. -
lookup
Description copied from interface:RemoteLookupLooks up the unique ID of a remote delegate by its symbolic name.- Specified by:
lookupin interfaceRemoteLookup- Parameters:
name- the symbolic name of the remote delegate to look up- Returns:
- the unique ID of the remote delegate if found, null otherwise
-
lookup
Description copied from interface:RegistryLooks up the unique ID of a remote object.
Locates the remote delegate of a remote object and returns its unique ID. -
createRemoteDelegate
protected <T extends Remote> RemoteDelegate<T> createRemoteDelegate(UUID remoteId, T remoteObject, IndexedMethodCache methodCache) Creates a newRemoteDelegate.- Type Parameters:
T- the type of the target object- Parameters:
remoteId- the ID of the remote delegateremoteObject- the target object of the remote delegatemethodCache- the method cache for the target object (must be thread-safe!)- Returns:
- the new remote delegate
-