com.sun.faban.common
Class RegistryLocator

java.lang.Object
  extended by com.sun.faban.common.RegistryLocator

public class RegistryLocator
extends Object

The registry locator is the single access point for clients to locate and access the Faban registry either on the local or remote system.

Although the Registry implementation uses rmi underneath, the rmi registry is fully encapsulated inside the Registry and RegistryLocator to avoid any confusion in the agent programs and other programs accessing the registry.

Author:
Akara Sucharitakul

Field Summary
static int DEFAULT_PORT
          The default registry port for Faban - 9998.
 
Constructor Summary
RegistryLocator()
           
 
Method Summary
static Registry getRegistry()
          Obtains a reference to the registry on the local system using the system property faban.registry.port as the port.
static Registry getRegistry(int port)
          Obtains a reference to the registry on the local system using the port specified.
static Registry getRegistry(String master)
          Obtains a reference to the registry on the remote master system using the system property faban.registry.port as the port.
static Registry getRegistry(String master, int port)
          Obtains a reference to the registry on the remote master system using the port specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
The default registry port for Faban - 9998.

See Also:
Constant Field Values
Constructor Detail

RegistryLocator

public RegistryLocator()
Method Detail

getRegistry

public static Registry getRegistry()
                            throws RemoteException,
                                   NotBoundException
Obtains a reference to the registry on the local system using the system property faban.registry.port as the port.

Returns:
A remote reference to the registry
Throws:
RemoteException - Cannot access the registry.
NotBoundException - The registry itself is not bound.

getRegistry

public static Registry getRegistry(String master)
                            throws RemoteException,
                                   NotBoundException
Obtains a reference to the registry on the remote master system using the system property faban.registry.port as the port.

Parameters:
master - The master host name
Returns:
A remote reference to the registry
Throws:
RemoteException - Cannot access the registry
NotBoundException - The registry itself is not bound

getRegistry

public static Registry getRegistry(int port)
                            throws RemoteException,
                                   NotBoundException
Obtains a reference to the registry on the local system using the port specified.

Parameters:
port - The port to connect to the registry
Returns:
A remote reference to the registry
Throws:
RemoteException - Cannot access the registry.
NotBoundException - The registry itself is not bound.

getRegistry

public static Registry getRegistry(String master,
                                   int port)
                            throws RemoteException,
                                   NotBoundException
Obtains a reference to the registry on the remote master system using the port specified.

Parameters:
master - The master host name
port - The port to connect to the registry
Returns:
A remote reference to the registry
Throws:
RemoteException - Cannot access the registry
NotBoundException - The registry itself is not bound