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 TypeMethodDescriptionvoid
Returns theAFNaming
instance responsible for this registry.final boolean
isLocal()
Returnstrue
if the wrapped Registry instance is locally created.boolean
Deprecated.String[]
list()
Returns the remote reference bound to the specifiedname
in this registry.void
void
-
Method Details
-
isRemoteServer
Deprecated.Returnstrue
if the wrapped Registry instance is a locally createdRemoteServer
.- Returns:
true
if wrapped instance is a locally createdRemoteServer
.- See Also:
-
isLocal
public final boolean isLocal()Returnstrue
if the wrapped Registry instance is locally created.- Returns:
true
if wrapped instance is locally created.
-
getNaming
-
lookup
- Specified by:
lookup
in interfaceRegistry
- Throws:
RemoteException
NotBoundException
AccessException
-
bind
public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException - Specified by:
bind
in interfaceRegistry
- Throws:
RemoteException
AlreadyBoundException
AccessException
-
unbind
- Specified by:
unbind
in interfaceRegistry
- Throws:
RemoteException
NotBoundException
AccessException
-
rebind
- Specified by:
rebind
in interfaceRegistry
- Throws:
RemoteException
AccessException
-
list
- Specified by:
list
in interfaceRegistry
- Throws:
RemoteException
AccessException
-
lookup
public Remote lookup(String name, long timeout, TimeUnit unit) throws NotBoundException, RemoteException Returns the remote reference bound to the specifiedname
in 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
- ifname
is not currently bound and couldn't be resolved in the specified time.RemoteException
- if remote communication with the registry failed; if exception is aServerException
containing 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
- ifname
isnull
-