FileDocCategorySizeDatePackage
HASingletonElectionPolicyBase.javaAPI DocJBoss 4.2.13125Fri Jul 13 20:52:36 BST 2007org.jboss.ha.singleton

HASingletonElectionPolicyBase

public abstract class HASingletonElectionPolicyBase extends org.jboss.system.ServiceMBeanSupport implements HASingletonElectionPolicyMBean
A base class for policy service that decides which node in the cluster should be the master node to run certain HASingleton service.
author
Alex Fu
version
$Revision: 46010 $

Fields Summary
private Object
mManagedSingleton
private org.jboss.ha.framework.interfaces.HAPartition
mPartition
Constructors Summary
Methods Summary
public org.jboss.ha.framework.interfaces.HAPartitiongetHAPartition()

see
HASingletonElectionPolicyMBean#getHAPartition()

      return this.mPartition;
   
public java.lang.ObjectgetManagedSingleton()

see
HASingletonElectionPolicyMBean#getManagedSingleton()

      return this.mManagedSingleton;
   
public booleanisElectedMaster()

see
HASingletonElectionPolicyMBean#isElectedMaster()

      if (null == this.mPartition)
         throw new IllegalStateException("HAPartition is not set");
      
      return pickSingleton().equals(this.mPartition.getClusterNode());
   
public booleanisElectedMaster(org.jboss.ha.framework.interfaces.HAPartition partition)

see
HASingletonElectionPolicyMBean#isElectedMaster(HAPartition)

      if (null == partition)
         throw new IllegalStateException("parameter cannot be null");

      return pickSingleton(partition).equals(partition.getClusterNode());
   
public voidsetHAPartition(org.jboss.ha.framework.interfaces.HAPartition partition)

see
HASingletonElectionPolicyMBean#setHAPartition(HAPartition)

      this.mPartition = partition;
   
public voidsetManagedSingleton(java.lang.Object singleton)

see
HASingletonElectionPolicyMBean#setManagedSingleton(Object)

      this.mManagedSingleton = singleton;