Save This Page
Home » jboss-5.0.0.CR1-src » org.jboss.ha » singleton » [javadoc | source]
org.jboss.ha.singleton
public class: HASingletonSupport [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.ha.jmx.HAServiceMBeanSupport
            org.jboss.ha.singleton.HASingletonSupport

All Implemented Interfaces:
    HASingletonMBean, HASingleton, HAServiceMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

Direct Known Subclasses:
    HASingletonControllerTester, HASingletonController, HASingletonSupportTester

Base class for HA-Singleton services.
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Constructor:
 public HASingletonSupport() 
Method from org.jboss.ha.singleton.HASingletonSupport Summary:
_stopOldMaster,   createService,   getElectionPolicy,   getRestartOnMerge,   isMasterNode,   makeThisNodeMaster,   partitionTopologyChanged,   restartMaster,   setElectionPolicy,   setRestartOnMerge,   startNewMaster,   startSingleton,   stopSingleton
Methods from org.jboss.ha.jmx.HAServiceMBeanSupport:
_receiveRemoteNotification,   callAsyncMethodOnPartition,   callMethodOnPartition,   getDistributedState,   getHAPartition,   getPartitionName,   getSendLocalLifecycleNotifications,   getSendRemoteLifecycleNotifications,   getServiceHAName,   isDRMMasterReplica,   isRegisterThreadContextClassLoader,   partitionTopologyChanged,   registerDRMListener,   registerRPCHandler,   sendNotification,   sendNotificationRemote,   sendNotificationToLocalListeners,   setClusterPartition,   setDistributedState,   setHAPartition,   setRegisterThreadContextClassLoader,   setSendLocalLifecycleNotifications,   setSendRemoteLifecycleNotifications,   setServiceHAName,   setupPartition,   startService,   stopService,   unregisterDRMListener,   unregisterRPCHandler
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ha.singleton.HASingletonSupport Detail:
 public  void _stopOldMaster() 
    This method will be invoked twice by the local node when it stops as well as by the remote
 protected  void createService() throws Exception 
 public HASingletonElectionPolicy getElectionPolicy() 
 public boolean getRestartOnMerge() 
    Gets whether this singleton will stop and restart itself if it is the master and a cluster merge occurs.

    A restart allows the service to reset any state that may have gotten out-of-sync with the rest of the cluster while the just-merged split was in effect.

 public boolean isMasterNode() 
 protected  void makeThisNodeMaster() 
 public  void partitionTopologyChanged(List newReplicants,
    int newViewID,
    boolean merge) 
    When topology changes, a new master is elected based on the result of the isDRMMasterReplica() call.
 protected  void restartMaster() 
 public  void setElectionPolicy(HASingletonElectionPolicy mb) 
 public  void setRestartOnMerge(boolean restartOnMerge) 
    Sets whether this singleton will stop and restart itself if it is the master and a cluster merge occurs?

    A restart allows the service to reset any state that may have gotten out-of-sync with the rest of the cluster while the just-merged split was in effect.

 protected  void startNewMaster() 
 public  void startSingleton() 
    Extending classes should override this method and implement the custom singleton logic. Only one node in the cluster is the active master. If the current node is elected for master, this method is invoked. When another node is elected for master for some reason, the stopSingleton() method is invokded.

    When the extending class is a stateful singleton, it will usually use putDistributedState() and getDistributedState() to save in the cluster environment information that will be needed by the next node elected for master should the current master node fail.

 public  void stopSingleton() 
    Extending classes should override this method and implement the custom singleton logic. Only one node in the cluster is the active master. If the current node is master and another node is elected for master, this method is invoked.