java.lang.Object
org.newsclub.net.unix.rmi.AFRegistry
- Direct Known Subclasses:
AFUNIXRegistry
A wrapper for RMI registries, both remote and local, to allow for a clean removal of bound
resources upon shutdown.
- Author:
- Christian Kohlschütter
-
Field Summary
Fields inherited from interface java.rmi.registry.Registry
REGISTRY_PORT -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns theAFNaminginstance responsible for this registry.final booleanisLocal()Returnstrueif the wrapped Registry instance is locally created.booleanDeprecated.String[]list()Returns the remote reference bound to the specifiednamein this registry.voidvoid
-
Method Details
-
isRemoteServer
Deprecated.Returnstrueif the wrapped Registry instance is a locally createdRemoteServer.- Returns:
trueif wrapped instance is a locally createdRemoteServer.- See Also:
-
isLocal
public final boolean isLocal()Returnstrueif the wrapped Registry instance is locally created.- Returns:
trueif wrapped instance is locally created.
-
getNaming
-
lookup
- Specified by:
lookupin interfaceRegistry- Throws:
RemoteExceptionNotBoundExceptionAccessException
-
bind
public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException - Specified by:
bindin interfaceRegistry- Throws:
RemoteExceptionAlreadyBoundExceptionAccessException
-
unbind
- Specified by:
unbindin interfaceRegistry- Throws:
RemoteExceptionNotBoundExceptionAccessException
-
rebind
- Specified by:
rebindin interfaceRegistry- Throws:
RemoteExceptionAccessException
-
list
- Specified by:
listin interfaceRegistry- Throws:
RemoteExceptionAccessException
-
lookup
public Remote lookup(String name, long timeout, TimeUnit unit) throws NotBoundException, RemoteException Returns the remote reference bound to the specifiednamein this registry. If the reference has not been bound yet, repeated attempts to resolve it are made until the specified time elapses.- Parameters:
name- the name for the remote reference to look uptimeout- The timeout value.unit- The timeout unit.- Returns:
- a reference to a remote object
- Throws:
NotBoundException- ifnameis not currently bound and couldn't be resolved in the specified time.RemoteException- if remote communication with the registry failed; if exception is aServerExceptioncontaining anAccessException, then the registry denies the caller access to perform this operationAccessException- if this registry is local and it denies the caller access to perform this operationNullPointerException- ifnameisnull
-