|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.varia.scheduler.AbstractScheduleProvider
public abstract class AbstractScheduleProvider
Abstract Base Class for Schedule Providers. The class used to extend HASingletonSupport, but not anymore. We can achieve the same effect without a dependency on HA jars using just a depends clause that starts/stops the schedule provide using the notifications produced by another HASingleton (see JBAS-3082)
Field Summary |
---|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
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 to the Schedule Manager |
javax.management.ObjectName |
getScheduleManagerName()
Get the Schedule Manager Name |
protected void |
removeSchedule(int pID)
Remove a Schedule from the Schedule Manager |
void |
setScheduleManagerName(javax.management.ObjectName scheduleManagerName)
Set the Schedule Manager Name |
abstract void |
startProviding()
Add the Schedules to the Schedule Manager |
protected void |
startScheduleProviderService()
Registers this schedule provider to the schedule manager |
protected void |
startService()
When the Service is started it will register itself at the Schedule Manager which makes it necessary that the Schedule Manager is already running. |
abstract void |
stopProviding()
Stops the Provider from providing and causing him to remove all Schedules |
protected void |
stopScheduleProviderService()
Unregisters this schedule provider to the schedule manager |
protected void |
stopService()
When the Service is stopped it will unregister itself at the Schedule Manager. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, createService, destroy, destroyService, getDeploymentInfo, 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, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Constructor Detail |
---|
public AbstractScheduleProvider()
Method Detail |
---|
public javax.management.ObjectName getScheduleManagerName()
getScheduleManagerName
in interface AbstractScheduleProviderMBean
public void setScheduleManagerName(javax.management.ObjectName scheduleManagerName)
setScheduleManagerName
in interface AbstractScheduleProviderMBean
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 startService() throws Exception
startProviding()
which is the point 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())
startService
in class org.jboss.system.ServiceMBeanSupport
Exception
protected void stopService() throws Exception
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())
stopService
in class org.jboss.system.ServiceMBeanSupport
Exception
protected void startScheduleProviderService() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
protected void stopScheduleProviderService() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |