public class ManageableRegistry
extends sun.rmi.registry.RegistryImpl
Modifier and Type | Method and Description |
---|---|
void |
bind(java.lang.String name,
java.rmi.Remote obj)
Binds a name to an object, overwriting any existing binding.
|
static java.rmi.registry.Registry |
createManagableRegistry(int port,
int objectPort)
Create a new registry on given port and use exported object port given
|
java.lang.String[] |
list()
Enumerates the names bound in the named context, along with the class
names of objects bound to them.
|
java.rmi.Remote |
lookup(java.lang.String name)
Retrieves the named object.
|
static void |
main(java.lang.String[] args)
Start a new Registry
|
void |
purge()
Remove objects of the registry
|
void |
rebind(java.lang.String name,
java.rmi.Remote obj)
ReBinds a name to an object, overwriting any existing binding.
|
void |
setVerbose(boolean v)
Set verbosity
|
void |
unbind(java.lang.String name)
Unbinds the named object.
|
public void setVerbose(boolean v)
v
- true/falsepublic java.rmi.Remote lookup(java.lang.String name) throws java.rmi.RemoteException, java.rmi.NotBoundException
lookup
in interface java.rmi.registry.Registry
lookup
in class sun.rmi.registry.RegistryImpl
name
- the name of the object to look upjava.rmi.RemoteException
- if a naming exception is encounteredjava.rmi.NotBoundException
- if object is not boundpublic void bind(java.lang.String name, java.rmi.Remote obj) throws java.rmi.RemoteException, java.rmi.AlreadyBoundException, java.rmi.AccessException
bind
in interface java.rmi.registry.Registry
bind
in class sun.rmi.registry.RegistryImpl
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nulljava.rmi.RemoteException
- if a bind cannot be done exception is encounteredjava.rmi.AlreadyBoundException
- if object is already boundjava.rmi.AccessException
- if cannot bindpublic void unbind(java.lang.String name) throws java.rmi.RemoteException, java.rmi.NotBoundException, java.rmi.AccessException
name
from the target context--that named by all but the
terminal atomic part of name
.unbind
in interface java.rmi.registry.Registry
unbind
in class sun.rmi.registry.RegistryImpl
name
- the name to unbind; may not be emptyjava.rmi.RemoteException
- if a naming exception is encounteredjava.rmi.NotBoundException
- if object was not boundjava.rmi.AccessException
- if unbind is not authorizedpublic void rebind(java.lang.String name, java.rmi.Remote obj) throws java.rmi.RemoteException, java.rmi.AccessException
rebind
in interface java.rmi.registry.Registry
rebind
in class sun.rmi.registry.RegistryImpl
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nulljava.rmi.RemoteException
- if a bind cannot be done exception is encounteredjava.rmi.AccessException
- if cannot bindpublic java.lang.String[] list() throws java.rmi.RemoteException
list
in interface java.rmi.registry.Registry
list
in class sun.rmi.registry.RegistryImpl
java.rmi.RemoteException
- if a naming exception is encounteredpublic static java.rmi.registry.Registry createManagableRegistry(int port, int objectPort) throws java.rmi.RemoteException
port
- registry portobjectPort
- exported objects portjava.rmi.RemoteException
- if registry cannot be builtpublic void purge()
public static void main(java.lang.String[] args)
args
- arguments for starting registry