|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.ha.jmx.HAServiceMBeanSupport org.jboss.ha.singleton.HASingletonSupport org.jboss.varia.scheduler.AbstractScheduleProvider
Abstract Base Class for Schedule Provider. Any Schedule Provider should extend from this class or must provide the MBean Interface methods. This class is cluster aware and allows the use of the HASingleton MBean attribute to control whether or not it should run as a singleton service or not. When HASingleton is set to true the MBean will usually declare dependency on a cluster partition. When not explicitly set the attribute defaults to false.
Field Summary |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.varia.scheduler.AbstractScheduleProviderMBean |
OBJECT_NAME |
Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
AbstractScheduleProvider()
Default (no-args) Constructor |
Method Summary | |
protected int |
addSchedule(javax.management.ObjectName pTarget,
String pMethodName,
String[] pMethodSignature,
Date pStart,
long pPeriod,
int pRepetitions)
Add a single Schedule add the Schedule Manager |
String |
getScheduleManagerName()
Get the Schedule Manager Name |
boolean |
isHASingleton()
determines whether or not the service is clustered singleton |
protected void |
removeSchedule(int pID)
Remove a Schedule from the Schedule Manager |
void |
setHASingleton(boolean hasingleton)
determines whether or not the service is clustered singleton |
void |
setScheduleManagerName(String pSchedulerManagerName)
Set the Schedule Manager Name |
abstract void |
startProviding()
Add the Schedules to the Schedule Manager |
protected void |
startScheduleProviderService()
When the Service is started it will register itself at the Schedule Manager which makes it necessary that the Schedule Manager is already running. |
protected void |
startService()
|
void |
startSingleton()
When HASingleton is enabled, this method will be invoked on the master node to start the singleton. |
abstract void |
stopProviding()
Stops the Provider from providing and causing him to remove all Schedules |
protected void |
stopScheduleProviderService()
When the Service is stopped it will unregister itself at the Schedule Manager. |
protected void |
stopService()
|
void |
stopSingleton()
When HASingleton is enabled, this method will be invoked on the master node to stop the singleton. |
Methods inherited from class org.jboss.ha.singleton.HASingletonSupport |
_stopOldMaster, isMasterNode, makeThisNodeMaster, partitionTopologyChanged |
Methods inherited from class org.jboss.ha.jmx.HAServiceMBeanSupport |
_receiveRemoteNotification, callAsyncMethodOnPartition, callMethodOnPartition, callMethodOnPartition, findHAPartitionWithName, getDistributedState, getPartition, getPartitionName, getServiceHAName, isDRMMasterReplica, registerDRMListener, registerRPCHandler, sendNotification, sendNotificationRemote, sendNotificationToLocalListeners, setDistributedState, setPartitionName, setupPartition, unregisterDRMListener, unregisterRPCHandler |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
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 org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.ha.singleton.HASingletonMBean |
isMasterNode |
Methods inherited from interface org.jboss.ha.jmx.HAServiceMBean |
callMethodOnPartition, getDistributedState, getPartitionName, sendNotification, setDistributedState, setPartitionName |
Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
Methods inherited from interface javax.management.NotificationBroadcaster |
addNotificationListener, getNotificationInfo, removeNotificationListener |
Constructor Detail |
public AbstractScheduleProvider()
Method Detail |
public String getScheduleManagerName()
getScheduleManagerName
in interface AbstractScheduleProviderMBean
public void setScheduleManagerName(String pSchedulerManagerName) throws javax.management.MalformedObjectNameException
setScheduleManagerName
in interface AbstractScheduleProviderMBean
javax.management.MalformedObjectNameException
public abstract void startProviding() throws Exception
startProviding
in interface AbstractScheduleProviderMBean
Exception
public abstract void stopProviding()
stopProviding
in interface AbstractScheduleProviderMBean
protected int addSchedule(javax.management.ObjectName pTarget, String pMethodName, String[] pMethodSignature, Date pStart, long pPeriod, int pRepetitions) throws javax.management.JMException
pTarget
- Object Name of the target MBean (receiver
of the time notification)pMethodName
- Name of the Method to be called on the
targetpMethodSignature
- Signature of the MethodpStart
- Date when the Schedule has to startpPeriod
- Time between two notificationspRepetitions
- Number of repetitions (-1 for unlimited)
javax.management.JMException
protected void removeSchedule(int pID) throws javax.management.JMException
pID
- Identification of the Schedule
javax.management.JMException
protected void startScheduleProviderService() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
startProviding()
which is the point to for the Provider to add
the Schedules on the Schedule Manager.
ATTENTION: If you overwrite this method in a subclass you have
to call this method (super.startService())
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
protected void stopScheduleProviderService() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
stopProviding()
which
is the point for the Provider to remove the Schedules from the
Schedule Manager.
ATTENTION: If you overwrite this method in a subclass you have
to call this method (super.stopService())
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
protected void startService() throws Exception
Exception
protected void stopService() throws Exception
Exception
public void startSingleton()
startSingleton
in interface org.jboss.ha.singleton.HASingleton
HASingletonSupport
public void stopSingleton()
stopSingleton
in interface org.jboss.ha.singleton.HASingleton
HASingletonSupport
public boolean isHASingleton()
isHASingleton
in interface AbstractScheduleProviderMBean
public void setHASingleton(boolean hasingleton)
setHASingleton
in interface AbstractScheduleProviderMBean
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |