org.jboss.ha.singleton
Class HASingletonController
java.lang.Object
org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.ha.jmx.HAServiceMBeanSupport (src)
org.jboss.ha.singleton.HASingletonSupport (src)
org.jboss.ha.singleton.HASingletonController
- All Implemented Interfaces:
- HAServiceMBean (src) , HASingleton (src) , HASingletonControllerMBean (src) , HASingletonMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)
- Direct Known Subclasses:
- HASingletonControllerTester (src)
- public class HASingletonController
- extends HASingletonSupport (src)
- implements HASingletonControllerMBean (src)
Allows singleton MBeans to be
added declaratively at deployment time
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Methods inherited from class org.jboss.ha.jmx.HAServiceMBeanSupport (src) |
_receiveRemoteNotification, callAsyncMethodOnPartition, callMethodOnPartition, callMethodOnPartition, findHAPartitionWithName, getDistributedState, getPartition, getPartitionName, getServiceHAName, isDRMMasterReplica, registerDRMListener, registerRPCHandler, sendNotification, sendNotificationRemote, sendNotificationToLocalListeners, setDistributedState, setPartitionName, setupPartition, startService, stopService, unregisterDRMListener, unregisterRPCHandler |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HASingletonController
public HASingletonController()
startSingleton
public void startSingleton()
- Description copied from class:
HASingletonSupport (src)
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.
- Specified by:
startSingleton
in interface HASingleton (src)
- Overrides:
startSingleton
in class HASingletonSupport (src)
- See Also:
HASingleton
(src)
stopSingleton
public void stopSingleton()
- Description copied from class:
HASingletonSupport (src)
- 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.
- Specified by:
stopSingleton
in interface HASingleton (src)
- Overrides:
stopSingleton
in class HASingletonSupport (src)
- See Also:
HASingleton
(src)
invokeSingletonMBeanMethod
protected java.lang.Object invokeSingletonMBeanMethod(ObjectName (src) name,
java.lang.String operationName,
java.lang.Object param)
throws InstanceNotFoundException (src) ,
MBeanException (src) ,
ReflectionException (src)
- Throws:
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
getTargetName
public ObjectName (src) getTargetName()
- Specified by:
getTargetName
in interface HASingletonControllerMBean (src)
- Returns:
- Object Name of the Target MBean for the timer notifications
setTargetName
public void setTargetName(ObjectName (src) targetObjectName)
- Description copied from interface:
HASingletonControllerMBean (src)
- Sets the fully qualified JMX MBean Object Name of the Schedulable MBean to be called.
- Specified by:
setTargetName
in interface HASingletonControllerMBean (src)
getTargetStartMethod
public java.lang.String getTargetStartMethod()
- Specified by:
getTargetStartMethod
in interface HASingletonControllerMBean (src)
- Returns:
- start method description of the target MBean to be called
setTargetStartMethod
public void setTargetStartMethod(java.lang.String targetStartMethod)
throws java.security.InvalidParameterException
- Description copied from interface:
HASingletonControllerMBean (src)
- Sets the start method name to be called on the Singleton MBean.
- Specified by:
setTargetStartMethod
in interface HASingletonControllerMBean (src)
- Throws:
java.security.InvalidParameterException
getTargetStopMethod
public java.lang.String getTargetStopMethod()
- Specified by:
getTargetStopMethod
in interface HASingletonControllerMBean (src)
- Returns:
- stop method description of the target MBean to be called
setTargetStopMethod
public void setTargetStopMethod(java.lang.String targetStopMethod)
throws java.security.InvalidParameterException
- Description copied from interface:
HASingletonControllerMBean (src)
- Sets the stop method name to be called on the Singleton MBean.
- Specified by:
setTargetStopMethod
in interface HASingletonControllerMBean (src)
- Throws:
java.security.InvalidParameterException
getTargetStartMethodArgument
public java.lang.String getTargetStartMethodArgument()
- Specified by:
getTargetStartMethodArgument
in interface HASingletonControllerMBean (src)
- Returns:
- start method argument of the target MBean to be called
setTargetStartMethodArgument
public void setTargetStartMethodArgument(java.lang.String targetStartMethodArgument)
- Description copied from interface:
HASingletonControllerMBean (src)
- Sets the argument to be passed to the start method of the Singleton MBean.
- Specified by:
setTargetStartMethodArgument
in interface HASingletonControllerMBean (src)
getTargetStopMethodArgument
public java.lang.String getTargetStopMethodArgument()
- Specified by:
getTargetStopMethodArgument
in interface HASingletonControllerMBean (src)
- Returns:
- stop method argument of the target MBean to be called
setTargetStopMethodArgument
public void setTargetStopMethodArgument(java.lang.String targetStopMethodArgument)
- Description copied from interface:
HASingletonControllerMBean (src)
- Sets the argument to be passed to the stop method of the Singleton MBean.
- Specified by:
setTargetStopMethodArgument
in interface HASingletonControllerMBean (src)