com.sun.faban.common
Interface Registry

All Superinterfaces:
Remote
All Known Implementing Classes:
RegistryImpl

public interface Registry
extends Remote

The methods in this interface are the public face of Registry The Registry is the single remote object that runs on the master machine and with which all other instances of remote servers reregister. A remote reference to any remote service is obtained by the GUI as well as the Engine through the registry. There is only one remote server object (the Registry) that is on the master machine. Once a reference to the Registry is obtained by the client, it should use the 'getReference' method to obtain a reference to any type of remote server.

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:
Shanti Subrmanyam

Method Summary
 int getNumServices(String type)
          Get the number of registered services of a given type.
 Remote getService(String name)
          Get reference to the service from the registry.
 Remote getService(String type, String name)
          Get reference to service from registry.
 Remote[] getServices(String type)
          Get all references to a type of services from registry.
 void kill()
          Kill is called to exit the RMI registry and Registry.
 boolean register(String name, Remote service)
          Registers service with Registry.
 boolean register(String type, String name, Remote service)
          Registers service with Registry.
 void reregister(String name, Remote service)
          Re-registers service with Registry, replacing old entry if exists.
 void reregister(String type, String name, Remote service)
          Re-registers service with Registry, replacing old entry if exists.
 void unregister(String name)
          Unregisters service from Registry.
 void unregister(String type, String name)
          Unregisters service from Registry.
 

Method Detail

register

boolean register(String name,
                 Remote service)
                 throws RemoteException
Registers service with Registry. The service driverName is of the form @ For example, a CmdAgent will reregister itself as CmdAgent@ so all CmdAgents on different machines can be uniquely identified by driverName.

Parameters:
name - public driverName of service
service - Remote reference to service
Returns:
true if registration succeeded, false if there is already an object registered by this name.
Throws:
RemoteException - A network error occurred

register

boolean register(String type,
                 String name,
                 Remote service)
                 throws RemoteException
Registers service with Registry. The service driverName is of the form @ For example, a CmdAgent will reregister itself as CmdAgent@ so all CmdAgents on different machines can be uniquely identified by driverName.

Parameters:
type - of service
name - of service
service - Remote reference to service
Returns:
true if registration succeeded, false if there is already an object registered by this name.
Throws:
RemoteException - A network error occurred

reregister

void reregister(String name,
                Remote service)
                throws RemoteException
Re-registers service with Registry, replacing old entry if exists. The service driverName is of the form @ For example, a CmdAgent will reregister itself as CmdAgent@ so all CmdAgents on different machines can be uniquely identified by driverName.

Parameters:
name - public driverName of service
service - Remote reference to service
Throws:
RemoteException - A network error occurred

reregister

void reregister(String type,
                String name,
                Remote service)
                throws RemoteException
Re-registers service with Registry, replacing old entry if exists. The service driverName is of the form @ For example, a CmdAgent will reregister itself as CmdAgent@ so all CmdAgents on different machines can be uniquely identified by driverName.

Parameters:
type - of service
name - of service
service - Remote reference to service
Throws:
RemoteException - A network error occurred

unregister

void unregister(String name)
                throws RemoteException
Unregisters service from Registry. The registry removes this service from its list and clients can no longer access it. This method is typically called when the service exits.

Parameters:
name - public driverName of service
Throws:
RemoteException - A network error occurred

unregister

void unregister(String type,
                String name)
                throws RemoteException
Unregisters service from Registry. The registry removes this service from its list and clients can no longer access it. This method is typically called when the service exits.

Parameters:
type - of service
name - public driverName of service
Throws:
RemoteException - A network error occurred

getService

Remote getService(String name)
                  throws RemoteException
Get reference to the service from the registry. The registry searches in its list of registered services and returns a remote reference to the requested one. The service driverName is of the form @

Parameters:
name - public driverName of service
Returns:
remote reference
Throws:
RemoteException - A network error occurred

getService

Remote getService(String type,
                  String name)
                  throws RemoteException
Get reference to service from registry. The registry searches in its list of registered services and returns a remote reference to the requested one. The service driverName is of the form @

Parameters:
type - of service
name - public driverName of service
Returns:
remote reference
Throws:
RemoteException - A network error occurred

getServices

Remote[] getServices(String type)
                     throws RemoteException
Get all references to a type of services from registry. The registry searches in its list of registered services and returns all remote references to the requested type. The service driverName is of the form @

Parameters:
type - of service
Returns:
remote references
Throws:
RemoteException - A network error occurred

getNumServices

int getNumServices(String type)
                   throws RemoteException
Get the number of registered services of a given type.

Parameters:
type - The type of service
Returns:
The number of registered services
Throws:
RemoteException - A network error occurred

kill

void kill()
          throws RemoteException
Kill is called to exit the RMI registry and Registry.

Throws:
RemoteException - A network error occurred