|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DependableRegistry
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.
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 |
---|
static final java.lang.String DEPENDABLE_REGISTRY_NAME
Method Detail |
---|
IID bind(java.lang.String name, DependableRegistry.RegistryEntry entry, java.lang.Class serverType) throws java.rmi.RemoteException, java.rmi.AccessException
name
- The name associated with the remote object groupentry
- The RegistryEntry type associated with the member object implementationserverType
- The class object of the member object implementation
IID
identifier that can be used to remove a
replicated remote object from the binding set.
java.rmi.RemoteException
- Raised when remote operation failed.
java.rmi.AccessException
- Raised when this operation is not permitted.IID bind(java.lang.String name, DependableRegistry.RegistryEntry entry, java.lang.Class serverType, long leaseTime) throws java.rmi.RemoteException, java.rmi.AccessException
name
- The name associated with the remote object groupentry
- The RegistryEntry type associated with the member object implementationserverType
- The class object of the member object implementationleaseTime
- The lease time for the service
IID
identifier that can be used to remove a
replicated remote object from the binding set.
java.rmi.RemoteException
- Raised when remote operation failed.
java.rmi.AccessException
- Raised when this operation is not permitted.void unbind(IID bid) throws java.rmi.RemoteException, java.rmi.NotBoundException, java.rmi.AccessException
IID
object obtained when the replica has been registered.
bid
- the binding identifier obtained when the replica has
been registered
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.void refresh(IID iid) throws java.rmi.RemoteException, java.rmi.AccessException, java.rmi.NotBoundException
IID
). This method is used by the server-side
LeaseLayer
and is invoked through the RegistryLayer
.
iid
- The iid
of the server whose lease to refresh.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |