uka.karmi.rmi.registry
Class LocateRegistry

java.lang.Object
  extended byuka.karmi.rmi.registry.LocateRegistry

public final class LocateRegistry
extends java.lang.Object

This class can create registry stubs from a string. And it can create a registry object.

Note that there can only be ONE registry object per export point. Although the naming scheme depends on the technology objects, the syntax is an URL: protocol://hostname:exportpointID

Note that the local JVM can not access configuration information of a remote JVM. This means that the local JVM can only use the local configuration information to map an export point id of a remote JVM to (for example) a port number. This means that the configuration of all JVMs must be equal.

Every technology has a protocol string. The Transport class uses the protocol part of the URL to determine the technology it should call to build a UTID. If the protocol part is omitted "rmi://" is used.

The default value is rmi://LOCAL_IP_ADDRESS.

The default exportpointID is Registry.REGISTRY_PORT.

Author:
Christian Nester, Bernhard Haumacher

Constructor Summary
private LocateRegistry()
           
 
Method Summary
static Registry createRegistry()
          Deprecated. Method incompatible to regular RMI, use createRegistry(Registry.REGISTRY_PORT) instead.
static Registry createRegistry(int exportId)
          Creates a registry object at a specific export point.
static Registry getRegistry()
          Returns a stub to the registry on the local host with location string "rmi://LOCAL_IP_ADDRESS"
static Registry getRegistry(int exportId)
          Returns a stub to the registry on the local host with location string "rmi://LOCAL_IP_ADDRESS:"+exportId
static Registry getRegistry(java.lang.String location)
          Returns a stub to the registry with the given location string.
static Registry getRegistry(java.lang.String host, int exportId)
           
private static Registry getRegularStub(RemoteStub registry)
          Convert a custom stub that was built on the client side into a regular stub created on the server side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocateRegistry

private LocateRegistry()
Method Detail

getRegistry

public static Registry getRegistry()
                            throws RemoteException
Returns a stub to the registry on the local host with location string "rmi://LOCAL_IP_ADDRESS"

Throws:
RemoteException

getRegistry

public static Registry getRegistry(java.lang.String location)
                            throws RemoteException
Returns a stub to the registry with the given location string.

Throws:
RemoteException

getRegistry

public static Registry getRegistry(int exportId)
                            throws RemoteException
Returns a stub to the registry on the local host with location string "rmi://LOCAL_IP_ADDRESS:"+exportId

Throws:
RemoteException

getRegistry

public static Registry getRegistry(java.lang.String host,
                                   int exportId)
                            throws RemoteException
Throws:
RemoteException

getRegularStub

private static Registry getRegularStub(RemoteStub registry)
                                throws RemoteException
Convert a custom stub that was built on the client side into a regular stub created on the server side. A custom stub created from an URL is not part of the distributed garbage collector. Only a stub created on the server side and marshaled to the client is fully functional. Ironically, a regular stub is essential for local usage as described in ticket:216.

Throws:
RemoteException

createRegistry

public static Registry createRegistry()
                               throws RemoteException
Deprecated. Method incompatible to regular RMI, use createRegistry(Registry.REGISTRY_PORT) instead.

Creates a registry object.

Throws:
RemoteException

createRegistry

public static Registry createRegistry(int exportId)
                               throws RemoteException
Creates a registry object at a specific export point.

Parameters:
exportId - ID of the export point
Throws:
RemoteException