FileDocCategorySizeDatePackage
DistributedReplicantManager.javaAPI DocJBoss 4.2.15486Fri Jul 13 20:52:38 BST 2007org.jboss.ha.framework.interfaces

DistributedReplicantManager

public interface DistributedReplicantManager
author
Bill Burke.
author
Sacha Labourey.
version
$Revision: 57188 $

Revisions:

2001/10/31: marcf

  1. DRM is no longer remote

2002/08/23: Sacha Labourey

  1. added isMasterReplica

Fields Summary
Constructors Summary
Methods Summary
public voidadd(java.lang.String key, java.io.Serializable replicant)
Add a replicant, it will be attached to this cluster node

param
key Replicant name. All replicas around the cluster must use the same key name.
param
replicant Local data of the replicant, that is, any serializable data
throws
Exception Thrown if a cluster communication problem occurs

public java.util.CollectiongetAllServices()
Return a list of all services that have a least one replicant.

return
A collection of services names (String)

public intgetReplicantsViewId(java.lang.String key)
Returns an id corresponding to the current view of this set of replicants.

param
key The replicant name
return
A view id (doesn't grow sequentially)

public booleanisMasterReplica(java.lang.String key)
Indicates if the current node is the master replica for this given key.

param
key The replicant name
return
True if this node is the master

public java.io.SerializablelookupLocalReplicant(java.lang.String key)
Lookup the replicant attached to this cluster node

param
key The name of the replicant
return
The local replicant for the give key name

public java.util.ListlookupReplicants(java.lang.String key)
Return a list of all replicants.

param
key The replicant name
return
An list of serialized replicants available around the cluster for the given key. This list will be in the same order in all nodes in the cluster.

public java.util.ListlookupReplicantsNodeNames(java.lang.String key)
Return a list of all replicants node names.

param
key The replicant name
return
A list the node names of cluster nodes that have made available a replicant for the given key. This list will be in the same order in all nodes in the cluster.

public voidregisterListener(java.lang.String key, org.jboss.ha.framework.interfaces.DistributedReplicantManager$ReplicantListener subscriber)
Subscribe a new listener {@link ReplicantListener} for replicants change

param
key Name of the replicant, must be identical cluster-wide for all identical replicants
param
subscriber The subsribing {@link ReplicantListener}

public voidremove(java.lang.String key)
Remove the entire key from the ReplicationService

param
key Name of the replicant
throws
Exception Thrown if a cluster communication problem occurs

public voidunregisterListener(java.lang.String key, org.jboss.ha.framework.interfaces.DistributedReplicantManager$ReplicantListener subscriber)
Unsubscribe a listener {@link ReplicantListener} that had subscribed for replicants changes

param
key Name of the replicant, must be identical cluster-wide for all identical replicants
param
subscriber The unsubscribing {@link ReplicantListener}