jgroup.relacs.registry
Class RelacsRegistryLocator

java.lang.Object
  extended by jgroup.relacs.registry.RelacsRegistryLocator
All Implemented Interfaces:
RegistryLocator

public final class RelacsRegistryLocator
extends java.lang.Object
implements RegistryLocator

RelacsRegistryLocator is used to obtain a bootstrap reference to the Jgroup dependable registry, or to create a Jgroup dependable registry instance on the local machine. Every instance of the Jgroup registry service is based on two remote registries: the standard local registry and the replicated one. The standard local registry is used to retrieve a reference for the replicated remote registry. The access port for these registries are configured in the XML configuration file.

Since:
Jgroup 0.3
Author:
Alberto Montresor, Hein Meling
See Also:
java.rmi.LocateRegistry

Constructor Summary
RelacsRegistryLocator()
          Will be used to obtain an instance of RegistryLocator.
 
Method Summary
 DependableRegistry createRegistry()
          Creates and exports a dependable registry replica on the local host listening for incoming requests on an the port specified in the system configuration file.
 DependableRegistry createRegistry(java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Creates and exports a dependable registry replica on the local host listening for incoming requests on an the port specified in the system configuration file.
 LookupRegistry getLookupRegistry()
          Returns a LookupRegistry interface, which can be used by clients to lookup a remote reference from registry.
 DependableRegistry getRegistry()
          Returns a proxy for the dependable registry service.
 DependableRegistry getRegistry(java.rmi.server.RMIClientSocketFactory csf)
          Returns a proxy for the dependable registry service formed by all registry replica instances found within the distributed system configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelacsRegistryLocator

public RelacsRegistryLocator()
Will be used to obtain an instance of RegistryLocator.

Method Detail

getRegistry

public DependableRegistry getRegistry()
                               throws JgroupException,
                                      java.rmi.RemoteException
Returns a proxy for the dependable registry service.

Specified by:
getRegistry in interface RegistryLocator
Returns:
A proxy for the dependable registry service.
Throws:
java.rmi.RemoteException - Raised if the proxy could not be obtained.
ConfigurationException - Raised if there is a problem with the distributed system configuration data.
JgroupException

getRegistry

public DependableRegistry getRegistry(java.rmi.server.RMIClientSocketFactory csf)
                               throws JgroupException,
                                      java.rmi.RemoteException
Returns a proxy for the dependable registry service formed by all registry replica instances found within the distributed system configuration.

Communication with this remote registry will use the supplied RMIClientSocketFactory csf to create socket connections to the dependable registry on the distributed system and port.

Note that the method returns the same group reference (variable drProxy) for the dependable registry upon multiple invocations of this method. However, the threads continue to run also after the first invocation, and thus the group proxy may be augmented with further dependable registry replicas. This means that, although the first (few) use(s) of the returned group proxy may have accessed only a subset of the available DR replicas, future invocations on the group proxy will include all available DR replicas.

Specified by:
getRegistry in interface RegistryLocator
Parameters:
csf - Client-side socket factory used to make connections to the dependable registry. If csf is null, then the default client-side socket factory will be used.
Returns:
A proxy for the dependable registry service
Throws:
java.rmi.RemoteException - If a proxy could not be obtained; probably due to unavailability of any registry replica instances.
ConfigurationException - Raised if there is a problem with the distributed system configuration data.
JgroupException

createRegistry

public DependableRegistry createRegistry()
                                  throws JgroupException,
                                         java.rmi.RemoteException
Creates and exports a dependable registry replica on the local host listening for incoming requests on an the port specified in the system configuration file.

Specified by:
createRegistry in interface RegistryLocator
Returns:
The newly created dependable registry replica.
Throws:
java.rmi.RemoteException - Raised if the registry could not be exported.
JgroupException - Raised if a registry instance could not be created.
ConfigurationException - Raised if there was a problem parsing the distributed system configuration file.

createRegistry

public DependableRegistry createRegistry(java.rmi.server.RMIClientSocketFactory csf,
                                         java.rmi.server.RMIServerSocketFactory ssf)
                                  throws java.rmi.RemoteException,
                                         JgroupException
Creates and exports a dependable registry replica on the local host listening for incoming requests on an the port specified in the system configuration file.

The new instance of the dependable registry listens to incoming requests using a ServerSocket created from the supplied RMIServerSocketFactory. A client that receives a reference to this registry will then use a Socket created from the supplied RMIClientSocketFactory.

Specified by:
createRegistry in interface RegistryLocator
Parameters:
csf - Client-side Socket factory used to make connections to the registry.
ssf - Server-side ServerSocket factory used to accept connections to the registry.
Returns:
The newly created dependable registry replica.
Throws:
java.rmi.RemoteException - Raised if the registry could not be exported.
JgroupException - Raised if a registry instance could not be created.
ConfigurationException - Raised if there was a problem parsing the distributed system configuration file.

getLookupRegistry

public LookupRegistry getLookupRegistry()
                                 throws JgroupException,
                                        java.rmi.RemoteException
Description copied from interface: RegistryLocator
Returns a LookupRegistry interface, which can be used by clients to lookup a remote reference from registry.

Specified by:
getLookupRegistry in interface RegistryLocator
Returns:
LookupRegistry with methods to lookup remote ref from registry.
Throws:
JgroupException
java.rmi.RemoteException


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.