jgroup.core.registry
Class RegistryFactory

java.lang.Object
  extended by jgroup.core.registry.RegistryFactory

public final class RegistryFactory
extends java.lang.Object

Class RegistryFactory is used to obtain a group proxy for the dependable registry service, or to create a dependable registry replica on the local machine.

Every instance (replica) of the dependable registry service is associated with a standard RMI registry, which is used to retrieve a group reference for the replicated remote registries.

Since:
Jgroup 0.8
Author:
Alberto Montresor, Hein Meling
See Also:
RelacsRegistryLocator

Method Summary
static 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.
static 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.
static LookupRegistry getLookupRegistry()
           
static DependableRegistry getRegistry()
          Returns a proxy for the dependable registry service.
static DependableRegistry getRegistry(java.rmi.server.RMIClientSocketFactory csf)
          Returns a proxy for the dependable registry service.
static void setLocator(RegistryLocator reglocator)
          Set the registry locator object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLocator

public static void setLocator(RegistryLocator reglocator)
Set the registry locator object.


getRegistry

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

Returns:
A proxy for the dependable registry service.
Throws:
java.rmi.RemoteException - Raised if the proxy could not be obtained.
ConfigurationException - Raised if there was a problem parsing the distributed system configuration file.
JgroupException

getLookupRegistry

public static LookupRegistry getLookupRegistry()
                                        throws java.rmi.RemoteException,
                                               JgroupException
Returns:
Returns an interface clients can use to obtain a remote reference from registry.
Throws:
java.rmi.RemoteException
JgroupException

getRegistry

public static DependableRegistry getRegistry(java.rmi.server.RMIClientSocketFactory csf)
                                      throws java.rmi.RemoteException,
                                             JgroupException
Returns a proxy for the dependable registry service. Communication with this remote registry will use the supplied RMIClientSocketFactory to create socket connections to the dependable registry on the distributed system and port.

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 - Raised if the proxy could not be obtained.
ConfigurationException - Raised if there was a problem parsing the distributed system configuration file.
JgroupException

createRegistry

public static DependableRegistry createRegistry()
                                         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.

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 static 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.

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.


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