All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.rmi.registry.UniVMRegistry

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----sdsu.rmi.registry.UniVMRegistry

public class UniVMRegistry
extends UnicastRemoteObject
implements RemoteRegistrar
UniVMRegistry allows server objects created in the VM that is running the rmi registy. This means you do not have to create a new VM and an new process for each object in the registry. The ".class" files, including the stub and skeletons for an object added to the registry must be accessable using the classpath of the process that created the UniVMRegistry and the rmiregistry.

The UniVMRegistry is a normal rmi registry with an object of type Registrant bound at the name "RemoteRegistrar". Use Registrar to register object to on a UniVMRegistry.

The easiest way to run a UniVMRegistry is using the command

 	java sdsu.rmi.registry.UniVMRegistry -p=5555 &
 
after you have an rmiregistry running on the given port. If the "-p" flag is not given, the default rmiregistry port 1099 is used.

Version:
0.9.1 2 Feb. 1998
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
Registrar

Variable Index

 o RMI_NAME

Constructor Index

 o UniVMRegistry()
Install a UniVMRegistry on the default rmiregistry port.
 o UniVMRegistry(int)
Install a UniVMRegistry on the given port.

Method Index

 o bind(String, Remote)
Binds the name to the specified remote object.
 o bind(String, String)
Binds the name to the specified remote object.
 o list()
Returns an array of the names in the registry.
 o main(String[])
Install a UniVMRegistry.
 o rebind(String, Remote)
Binds a Remote object created from the class className in the rmiregistry.
 o rebind(String, String)
Binds a Remote object created from the class className in the rmiregistry.

Variables

 o RMI_NAME
 public static final String RMI_NAME

Constructors

 o UniVMRegistry
 public UniVMRegistry() throws RemoteException
Install a UniVMRegistry on the default rmiregistry port. If a registry is active on that port make it a UniVMRegistry.

 o UniVMRegistry
 public UniVMRegistry(int port) throws RemoteException
Install a UniVMRegistry on the given port. If a registry is active on that port make it a UniVMRegistry.

Methods

 o rebind
 public void rebind(String name,
                    String className) throws RemoteException
Binds a Remote object created from the class className in the rmiregistry. Replaces and object currently bound at same name. The registry's classpath must include the className.

Parameters:
className - Full class name, used to create remote object.
name - Name to which object is bound
Returns:
s Name to which object is bound to.
Throws: RemoteException
thrown if there is any problem binding object.
 o rebind
 public void rebind(String name,
                    Remote object) throws RemoteException
Binds a Remote object created from the class className in the rmiregistry. Replaces and object currently bound at same name.

Parameters:
object - Remote object which is bound.
name - Name to which object is bound.
Returns:
s Name to which object is bound to.
Throws: RemoteException
thrown if there is any problem binding object.
 o bind
 public void bind(String name,
                  String remoteObjectClassName) throws RemoteException, AlreadyBoundException
Binds the name to the specified remote object.

Throws: RemoteException
If remote operation failed.
Throws: AlreadyBoundException
If name is already bound.
 o bind
 public void bind(String name,
                  Remote object) throws RemoteException, AlreadyBoundException
Binds the name to the specified remote object.

Throws: RemoteException
If remote operation failed.
Throws: AlreadyBoundException
If name is already bound.
 o list
 public String[] list() throws RemoteException, AccessException
Returns an array of the names in the registry.

Throws: RemoteException
If remote operation failed.
Throws: AccessException
If this operation is not permitted.
 o main
 public static void main(String args[])
Install a UniVMRegistry. To specify the port use the "-p" flag to specify a port other than the default rmiregistry port. If registry already exists on that port make it a UniVMRegistry. Prints out all names that are currently bound to objects in the registry.


All Packages  Class Hierarchy  This Package  Previous  Next  Index