jgroup.core.registry
Interface DependableRegistry

All Superinterfaces:
ExternalGMIListener, LookupRegistry, java.rmi.Remote
All Known Implementing Classes:
RegistryImpl

public interface DependableRegistry
extends LookupRegistry

For obtaining references to remote objects, RMI includes a registry service, that provides methods for storing and retrieving remote object references. Each registry object acts independently and maintains a different set of bindings (name, remote object), thus constituting a single point of failure. Furthermore, a registry object running on a certain host can be used to register only remote objects running on the same host; thus, in order to obtain a stub for a remote object, a client need to be aware of its location.

The registry implementation included with Jgroup has several advantages over the standard Java RMI registry. First, it enables a set of replicated remote objects to register themselves under the same name. This set forms a remote object group that can be retrieved as a single entity. All the Jgroup registry objects running in a distributed system cooperate in order to maintain a replicated database of bindings and offer a reliable and high-available repository facility. Clients no longer need to be aware of the location of a service: they can simply access the group of registry replicas and obtain a stub for every service registered in the distributed system. A stub for the registry group is obtained through the RegistryFactory.getRegistry methods.

A distributed system can be designed by including a certain number of registry replicas running on different hosts and possibly on distinct portions of the communication network. Client access these replicas through standard RMI interactions as if they were a single registry, and are guaranteed that their invocation will successfully terminate, provided that at least one operational replica is running in their partition.

During a partitioning, the Jgroup registry presents a partitioned behavior reflecting the current failure scenario. The registration of a remote object inside a partition will not affect the registry replicas not contained in that partition, while a retrieval operation will not success if the service we are looking for has been registered in another partition. Nevertheless, the replicas contained in a partition consistently maintain the same set of bindings and act as a single entity; moreover, the disappearance of the partitioning causes the execution of a reconciliation protocol in order to re-establish a consistent set of bindings among the replicas that belonged to different partitions. It is important to note that this behavior is perfectly reasonable for a partitionable distributed system, since clients asking for remote services are interested only in servers running in their current partitions.

The DependableRegistry interface describes the methods of a dependable registry that can be remotely invoked. To create a registry that runs in an application, use one of the RegistryFactory.createRegistry methods. To obtain a reference to a remote object registry, use one of the RegistryFactory.getRegistry methods.

Since:
Jgroup 0.3
Author:
Alberto Montresor, Hein Meling

Nested Class Summary
static interface DependableRegistry.RegistryEntry
          This interface must be implemented by all types that needs to be stored in a dependable registry.
 
Field Summary
static java.lang.String DEPENDABLE_REGISTRY_NAME
          Service name used to register each dependable registry replica in the local registry.
 
Method Summary
 IID bind(java.lang.String name, DependableRegistry.RegistryEntry entry, java.lang.Class serverType)
          Add a replicated member object to the remote object group associated with the specified name in the registry.
 IID bind(java.lang.String name, DependableRegistry.RegistryEntry entry, java.lang.Class serverType, long leaseTime)
          Add a replicated member object to the remote object group associated with the specified name in the registry.
 void refresh(IID iid)
          Update the timestamp (lease time) for the server associated with the given binding identifier (IID).
 void unbind(IID bid)
          Remove a replicated remote object identified by the IID object obtained when the replica has been registered.
 
Methods inherited from interface jgroup.core.registry.LookupRegistry
list, lookup
 

Field Detail

DEPENDABLE_REGISTRY_NAME

static final java.lang.String DEPENDABLE_REGISTRY_NAME
Service name used to register each dependable registry replica in the local registry.

See Also:
Constant Field Values
Method Detail

bind

IID bind(java.lang.String name,
         DependableRegistry.RegistryEntry entry,
         java.lang.Class serverType)
         throws java.rmi.RemoteException,
                java.rmi.AccessException
Add a replicated member object to the remote object group associated with the specified name in the registry.

Parameters:
name - The name associated with the remote object group
entry - The RegistryEntry type associated with the member object implementation
serverType - The class object of the member object implementation
Returns:
A IID identifier that can be used to remove a replicated remote object from the binding set.
Throws:
java.rmi.RemoteException - Raised when remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.

bind

IID bind(java.lang.String name,
         DependableRegistry.RegistryEntry entry,
         java.lang.Class serverType,
         long leaseTime)
         throws java.rmi.RemoteException,
                java.rmi.AccessException
Add a replicated member object to the remote object group associated with the specified name in the registry.

Parameters:
name - The name associated with the remote object group
entry - The RegistryEntry type associated with the member object implementation
serverType - The class object of the member object implementation
leaseTime - The lease time for the service
Returns:
A IID identifier that can be used to remove a replicated remote object from the binding set.
Throws:
java.rmi.RemoteException - Raised when remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.

unbind

void unbind(IID bid)
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException,
                   java.rmi.AccessException
Remove a replicated remote object identified by the IID object obtained when the replica has been registered.

Parameters:
bid - the binding identifier obtained when the replica has been registered
Throws:
java.rmi.RemoteException - If remote operation failed.
java.rmi.NotBoundException - if there is no object with this name in the registry.
java.rmi.AccessException - If this operation is not permitted.

refresh

void refresh(IID iid)
             throws java.rmi.RemoteException,
                    java.rmi.AccessException,
                    java.rmi.NotBoundException
Update the timestamp (lease time) for the server associated with the given binding identifier (IID). This method is used by the server-side LeaseLayer and is invoked through the RegistryLayer.

Parameters:
iid - The iid of the server whose lease to refresh.
Throws:
java.rmi.RemoteException - If remote operation failed.
java.rmi.NotBoundException - if there is no object in the registry matching the given IID.
java.rmi.AccessException - If this operation is not permitted.


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