|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.framework.server.DistributedReplicantManagerImpl
public class DistributedReplicantManagerImpl
This class manages replicated objects.
Nested Class Summary | |
---|---|
protected class |
DistributedReplicantManagerImpl.MembersPublisher
|
protected class |
DistributedReplicantManagerImpl.MergeMembers
|
Nested classes/interfaces inherited from interface org.jboss.ha.framework.interfaces.DistributedReplicantManager |
---|
org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener |
Constructor Summary | |
---|---|
DistributedReplicantManagerImpl(org.jboss.ha.framework.interfaces.HAPartition partition)
|
Method Summary | |
---|---|
void |
_add(String key,
String nodeName,
Serializable replicant)
Cluster callback called when a new replicant is added on another node |
void |
_remove(String key,
String nodeName)
Cluster callback called when a replicant is removed by another node |
void |
add(String key,
Serializable replicant)
|
protected boolean |
addReplicant(String key,
String nodeName,
Serializable replicant)
Add a replicant to the replicants map. |
protected int |
calculateReplicantsHash(List<org.jboss.ha.framework.interfaces.ClusterNode> members)
|
protected void |
cleanupKeyListeners()
|
void |
createService()
|
void |
destroyService()
|
Collection<String> |
getAllServices()
|
Serializable |
getCurrentState()
|
String |
getPartitionName()
Get the name of the underlying partition
used by this service. |
int |
getReplicantsViewId(String key)
|
boolean |
isMasterReplica(String key)
|
String |
listContent()
|
String |
listXmlContent()
|
Serializable |
lookupLocalReplicant(String key)
|
Object[] |
lookupLocalReplicants()
Cluster callback called when a node wants to know our complete list of local replicants |
List<Serializable> |
lookupReplicants(String key)
|
List<String> |
lookupReplicantsNodeNames(String key)
Deprecated. |
List<org.jboss.ha.framework.interfaces.ClusterNode> |
lookupReplicantsNodes(String key)
|
void |
membershipChanged(Vector deadMembers,
Vector newMembers,
Vector allMembers)
|
void |
membershipChangedDuringMerge(Vector deadMembers,
Vector newMembers,
Vector allMembers,
Vector originatingGroups)
|
protected void |
mergeMembers()
|
protected void |
notifyKeyListeners(String key,
List<Serializable> newReplicants,
boolean merge)
Notifies, through a callback, the listeners for a given replicant that the set of replicants has changed |
void |
processEvent(Object event)
|
protected void |
purgeDeadMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> deadMembers,
boolean merge)
Get rid of dead members from replicant list. |
void |
registerListener(String key,
org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener subscriber)
|
void |
registerWithJmx(MBeanServer server)
|
void |
remove(String key)
|
protected boolean |
removeReplicant(String key,
String nodeName)
|
protected void |
republishLocalReplicants()
|
void |
setCurrentState(Serializable newState)
|
void |
startService()
|
void |
stopService()
|
void |
unregisterListener(String key,
org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener subscriber)
|
void |
unregisterWithJmx(MBeanServer server)
|
protected int |
updateReplicantsHashId(String key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DistributedReplicantManagerImpl(org.jboss.ha.framework.interfaces.HAPartition partition)
Method Detail |
---|
public void createService() throws Exception
Exception
public void startService() throws Exception
Exception
public void stopService() throws Exception
Exception
public void destroyService() throws Exception
Exception
public void registerWithJmx(MBeanServer server) throws Exception
Exception
public void unregisterWithJmx(MBeanServer server) throws Exception
Exception
public String getPartitionName()
DistributedReplicantManagerImplMBean
name of the underlying partition
used by this service.
getPartitionName
in interface DistributedReplicantManagerImplMBean
public String listContent() throws Exception
listContent
in interface DistributedReplicantManagerImplMBean
Exception
public String listXmlContent() throws Exception
listXmlContent
in interface DistributedReplicantManagerImplMBean
Exception
public Serializable getCurrentState()
getCurrentState
in interface org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer
public void setCurrentState(Serializable newState)
setCurrentState
in interface org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer
public Collection<String> getAllServices()
getAllServices
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public void membershipChangedDuringMerge(Vector deadMembers, Vector newMembers, Vector allMembers, Vector originatingGroups)
membershipChangedDuringMerge
in interface org.jboss.ha.framework.interfaces.HAPartition.HAMembershipExtendedListener
public void membershipChanged(Vector deadMembers, Vector newMembers, Vector allMembers)
membershipChanged
in interface org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener
public void processEvent(Object event)
processEvent
in interface AsynchEventHandler.AsynchEventProcessor
public void add(String key, Serializable replicant) throws Exception
add
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
Exception
public void remove(String key) throws Exception
remove
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
Exception
public Serializable lookupLocalReplicant(String key)
lookupLocalReplicant
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public List<Serializable> lookupReplicants(String key)
lookupReplicants
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
@Deprecated public List<String> lookupReplicantsNodeNames(String key)
lookupReplicantsNodeNames
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public List<org.jboss.ha.framework.interfaces.ClusterNode> lookupReplicantsNodes(String key)
lookupReplicantsNodes
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public void registerListener(String key, org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener subscriber)
registerListener
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public void unregisterListener(String key, org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener subscriber)
unregisterListener
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public int getReplicantsViewId(String key)
getReplicantsViewId
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public boolean isMasterReplica(String key)
isMasterReplica
in interface org.jboss.ha.framework.interfaces.DistributedReplicantManager
public void _add(String key, String nodeName, Serializable replicant)
key
- Replicant keynodeName
- Node that add the current replicantreplicant
- Serialized representation of the replicantpublic void _remove(String key, String nodeName)
key
- Name of the replicant keynodeName
- Node that wants to remove its replicant for the give keyprotected boolean removeReplicant(String key, String nodeName)
public Object[] lookupLocalReplicants() throws Exception
Exception
- Thrown if a cluster communication exception occursprotected int calculateReplicantsHash(List<org.jboss.ha.framework.interfaces.ClusterNode> members)
protected int updateReplicantsHashId(String key)
protected boolean addReplicant(String key, String nodeName, Serializable replicant)
key
- replicant key namenodeName
- name of the node that adds this replicantreplicant
- Serialized representation of the replica
protected void notifyKeyListeners(String key, List<Serializable> newReplicants, boolean merge)
key
- The replicant key namenewReplicants
- The new list of replicantsmerge
- is the notification the result of a cluster merge?protected void republishLocalReplicants()
protected void mergeMembers()
protected void purgeDeadMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> deadMembers, boolean merge)
deadMembers
- the members that are no longer in the viewmerge
- whether the membership change occurred during
a cluster mergeprotected void cleanupKeyListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |