org.jboss.test.ha.singleton
Class HASingletonSupportTester
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.test.ha.singleton.HASingletonSupportTester
- All Implemented Interfaces:
- HAServiceMBean (src) , HASingleton (src) , HASingletonMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)
- public class HASingletonSupportTester
- extends HASingletonSupport (src)
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, findHAPartitionWithName, getDistributedState, getPartition, getPartitionName, getServiceHAName, sendNotificationRemote, sendNotificationToLocalListeners, setDistributedState, setPartitionName, startService, stopService |
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 |
__invokationStack__
public java.util.Stack __invokationStack__
__isDRMMasterReplica__
public boolean __isDRMMasterReplica__
__isSingletonStarted__
public boolean __isSingletonStarted__
HASingletonSupportTester
public HASingletonSupportTester()
setupPartition
protected void setupPartition()
throws java.lang.Exception
- Overrides:
setupPartition
in class HAServiceMBeanSupport (src)
- Throws:
java.lang.Exception
registerRPCHandler
protected void registerRPCHandler()
- Overrides:
registerRPCHandler
in class HAServiceMBeanSupport (src)
unregisterRPCHandler
protected void unregisterRPCHandler()
- Overrides:
unregisterRPCHandler
in class HAServiceMBeanSupport (src)
registerDRMListener
protected void registerDRMListener()
throws java.lang.Exception
- Overrides:
registerDRMListener
in class HAServiceMBeanSupport (src)
- Throws:
java.lang.Exception
unregisterDRMListener
protected void unregisterDRMListener()
throws java.lang.Exception
- Overrides:
unregisterDRMListener
in class HAServiceMBeanSupport (src)
- Throws:
java.lang.Exception
isDRMMasterReplica
protected boolean isDRMMasterReplica()
- Overrides:
isDRMMasterReplica
in class HAServiceMBeanSupport (src)
callMethodOnPartition
public void callMethodOnPartition(java.lang.String methodName,
java.lang.Object[] args)
throws java.lang.Exception
- Description copied from interface:
HAServiceMBean (src)
- Convenience method for broadcasting a call to all members
of a partition.
- Specified by:
callMethodOnPartition
in interface HAServiceMBean (src)
- Overrides:
callMethodOnPartition
in class HAServiceMBeanSupport (src)
- Parameters:
methodName
- args
-
- Throws:
java.lang.Exception
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)
makeThisNodeMaster
protected void makeThisNodeMaster()
- Overrides:
makeThisNodeMaster
in class HASingletonSupport (src)
sendNotification
public void sendNotification(Notification (src) notification)
- Description copied from interface:
HAServiceMBean (src)
- Broadcast the notification to the remote listener nodes (if any) and then
invoke super.sendNotification() to notify local listeners.
- Specified by:
sendNotification
in interface HAServiceMBean (src)
- Overrides:
sendNotification
in class HAServiceMBeanSupport (src)
- Parameters:
notification
- sent out to local listeners and other nodes. It should be serializable.
It is recommended that the source of the notification is an ObjectName of an MBean that
is is available on all nodes where the broadcaster MBean is registered.- See Also:
NotificationBroadcasterSupport.sendNotification(Notification)