org.objectweb.carol.jndi.registry.jrmp
Class ManageableRegistry

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by sun.rmi.registry.RegistryImpl
              extended by org.objectweb.carol.jndi.registry.jrmp.ManageableRegistry
All Implemented Interfaces:
java.io.Serializable, java.rmi.registry.Registry, java.rmi.Remote

public class ManageableRegistry
extends sun.rmi.registry.RegistryImpl

JRMP Registry without checks for bind This class do some invalid import on Sun classes and won't compile on free JVM.

Author:
Guillaume Rivi?re
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface java.rmi.registry.Registry
REGISTRY_PORT
 
Method Summary
 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, java.net.InetAddress inetAddress)
          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.
 
Methods inherited from class sun.rmi.registry.RegistryImpl
checkAccess, getID
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setVerbose

public void setVerbose(boolean v)
Set verbosity

Parameters:
v - true/false

lookup

public java.rmi.Remote lookup(java.lang.String name)
                       throws java.rmi.RemoteException,
                              java.rmi.NotBoundException
Retrieves the named object.

Specified by:
lookup in interface java.rmi.registry.Registry
Overrides:
lookup in class sun.rmi.registry.RegistryImpl
Parameters:
name - the name of the object to look up
Returns:
the object bound to name
Throws:
java.rmi.RemoteException - if a naming exception is encountered
java.rmi.NotBoundException - if object is not bound

bind

public void bind(java.lang.String name,
                 java.rmi.Remote obj)
          throws java.rmi.RemoteException,
                 java.rmi.AlreadyBoundException,
                 java.rmi.AccessException
Binds a name to an object, overwriting any existing binding. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.

Specified by:
bind in interface java.rmi.registry.Registry
Overrides:
bind in class sun.rmi.registry.RegistryImpl
Parameters:
name - the name to bind; may not be empty
obj - the object to bind; possibly null
Throws:
java.rmi.RemoteException - if a bind cannot be done exception is encountered
java.rmi.AlreadyBoundException - if object is already bound
java.rmi.AccessException - if cannot bind

unbind

public void unbind(java.lang.String name)
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException,
                   java.rmi.AccessException
Unbinds the named object. Removes the terminal atomic name in name from the target context--that named by all but the terminal atomic part of name.

Specified by:
unbind in interface java.rmi.registry.Registry
Overrides:
unbind in class sun.rmi.registry.RegistryImpl
Parameters:
name - the name to unbind; may not be empty
Throws:
java.rmi.RemoteException - if a naming exception is encountered
java.rmi.NotBoundException - if object was not bound
java.rmi.AccessException - if unbind is not authorized

rebind

public void rebind(java.lang.String name,
                   java.rmi.Remote obj)
            throws java.rmi.RemoteException,
                   java.rmi.AccessException
ReBinds a name to an object, overwriting any existing binding. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.

Specified by:
rebind in interface java.rmi.registry.Registry
Overrides:
rebind in class sun.rmi.registry.RegistryImpl
Parameters:
name - the name to bind; may not be empty
obj - the object to bind; possibly null
Throws:
java.rmi.RemoteException - if a bind cannot be done exception is encountered
java.rmi.AccessException - if cannot bind

list

public java.lang.String[] list()
                        throws java.rmi.RemoteException
Enumerates the names bound in the named context, along with the class names of objects bound to them. The contents of any subcontexts are not included.

Specified by:
list in interface java.rmi.registry.Registry
Overrides:
list in class sun.rmi.registry.RegistryImpl
Returns:
the names in this context.
Throws:
java.rmi.RemoteException - if a naming exception is encountered

createManagableRegistry

public static java.rmi.registry.Registry createManagableRegistry(int port,
                                                                 int objectPort,
                                                                 java.net.InetAddress inetAddress)
                                                          throws java.rmi.RemoteException
Create a new registry on given port and use exported object port given

Parameters:
port - registry port
objectPort - exported objects port
inetAddress - ip to use for the bind (instead of using all interfaces)
Returns:
a new Registry object
Throws:
java.rmi.RemoteException - if registry cannot be built

purge

public void purge()
Remove objects of the registry


main

public static void main(java.lang.String[] args)
Start a new Registry

Parameters:
args - arguments for starting registry