|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DistributedReplicantManager
DistributedReplicantManager is a service on top of HAPartition
that provides a
cluster-wide distributed state which is node-specific. The DistributedReplicantManager (DRM)
service provides a <String key, Serializable replicant> tuple map. Each node in the cluster
stores its own data for a given key. This data is replicated so that reading values for a key
is always performed locally.
Typical usages for DistributedReplicantManager are:
replicants
that services store in the DRM are information (e.g. RMI stubs, JBoss Remoting
InvokerLocator
instances, HTTP URLs etc) that remote clients
would need to contact the clustered service. This usage of DRM drives
the smart clustered proxy implementations used by JBoss AS.replicants
that services store in the DRM are usually
just simple placeholder strings; the presence of the tuple itself is
what indicates the service is available on a particular node. This usage
of DRM drives JBoss AS services like HASingleton.
Revisions:
2001/10/31: marcf
2002/08/23: Sacha Labourey
Nested Class Summary | |
---|---|
static interface |
DistributedReplicantManager.ReplicantListener
When a particular key in the DistributedReplicantManager table gets modified, all listeners will be notified of replicant changes for that key. |
Method Summary | |
---|---|
void |
add(String key,
Serializable replicant)
Add a replicant, which will be associated with this cluster node in the registry. |
Collection |
getAllServices()
Return a list of all services that have at least one replicant. |
int |
getReplicantsViewId(String key)
Returns an id corresponding to the current view of this set of replicants. |
boolean |
isMasterReplica(String key)
Indicates if the current node is the master replica for this given key; i.e. |
Serializable |
lookupLocalReplicant(String key)
Lookup the replicant associated with this cluster node and the given key |
List |
lookupReplicants(String key)
Return a list of all replicants for the given key. |
List |
lookupReplicantsNodeNames(String key)
Deprecated. Replaced by lookupReplicantsNodes(String) that
returns a List of ClusterNode. Call
ClusterNode.getName() on List entries to get same
behavior. |
List<ClusterNode> |
lookupReplicantsNodes(String key)
Return a list of the ClusterNode objects for all nodes that have
registered a replicant for the given key. |
void |
registerListener(String key,
DistributedReplicantManager.ReplicantListener subscriber)
Subscribe a new listener for replicant changes |
void |
remove(String key)
Remove this cluster node's replicant for the given key from the registry |
void |
unregisterListener(String key,
DistributedReplicantManager.ReplicantListener subscriber)
Unsubscribe a listener that had subscribed for replicant changes |
Method Detail |
---|
void registerListener(String key, DistributedReplicantManager.ReplicantListener subscriber)
listener
for replicant changes
key
- Name of the replicant, must be identical cluster-wide for all related replicantssubscriber
- The subscribing DistributedReplicantManager.ReplicantListener
void unregisterListener(String key, DistributedReplicantManager.ReplicantListener subscriber)
listener
that had subscribed for replicant changes
key
- Name of the replicant, must be identical cluster-wide for all identical replicantssubscriber
- The unsubscribing DistributedReplicantManager.ReplicantListener
void add(String key, Serializable replicant) throws Exception
key
- Replicant name. All related replicas around the cluster must use the same key name.replicant
- Local data of the replicant, that is, any serializable data
Exception
- Thrown if a cluster communication problem occursvoid remove(String key) throws Exception
key
- Name of the replicant
Exception
- Thrown if a cluster communication problem occursSerializable lookupLocalReplicant(String key)
key
- The name of the replicant
List lookupReplicants(String key)
key
- The replicant name
@Deprecated List lookupReplicantsNodeNames(String key)
lookupReplicantsNodes(String)
that
returns a List of ClusterNode. Call
ClusterNode.getName()
on List entries to get same
behavior.
key
- The replicant name
List<ClusterNode> lookupReplicantsNodes(String key)
ClusterNode
objects for all nodes that have
registered a replicant for the given key.
key
- The replicant name
ClusterNode
instances that have made available
a replicant for the given key. This list will be in the same
order in all nodes in the cluster.Collection getAllServices()
Collection
of service names; i.e. the
key
s passed to add(String, Serializable)
int getReplicantsViewId(String key)
key
- The replicant name
boolean isMasterReplica(String key)
lookupReplicantsNodes(key)
.
key
- The replicant name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |