|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.varia.scheduler.ScheduleManager
Schedule Manager which manage the Schedule and their matching Timer notifications and notification listeners. Each provider has to register when it is started where in turn their startProviding() method is called which allows him to add its Schedules because the Manager is now ready.
Nested Class Summary | |
class |
ScheduleManager.MBeanListener (src)
This listener is waiting for its Timer Notification and call the appropriate method on the given Target (MBean) and count down the number of remaining repetitions. |
Field Summary | |
static java.lang.String |
DEFAULT_TIMER_NAME
Default Timer Object Name |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
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 |
Constructor Summary | |
ScheduleManager()
Default (no-args) Constructor |
Method Summary | |
int |
addSchedule(ObjectName (src) pProvider,
ObjectName (src) pTarget,
java.lang.String pMethodName,
java.lang.String[] pMethodSignature,
java.util.Date pStartDate,
long pPeriod,
int pRepetitions)
Adds a new Schedule to the Scheduler |
protected void |
destroyService()
When Service is destroyed it will call the "unregisterProvider()" on all register Providers to let them remove their Schedules and being notified that they should stop providing. |
ObjectName (src) |
getObjectName(MBeanServer (src) pServer,
ObjectName (src) pName)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration. |
java.lang.String |
getSchedules()
Returns a list of the identifications of all registered schedules |
java.lang.String |
getTimerName()
|
boolean |
isPaused()
|
boolean |
isStartAtStartup()
|
boolean |
isStarted()
|
void |
registerProvider(java.lang.String pProviderObjectName)
Register a Provider to make him available. |
void |
removeSchedule(int pIdentification)
Removes a Schedule so that no notification is sent anymore |
void |
restartSchedule()
Stops the server right now and starts it right now. |
void |
setPaused(boolean pIsPaused)
Pauses or restarts the Schedules which either suspends the notifications or start transfering them to the target |
void |
setStartAtStartup(boolean pStartAtStartup)
Set the scheduler to start when MBean started or not. |
void |
setTimerName(java.lang.String pTimerName)
|
void |
startSchedules()
Starts all the containing Schedules |
protected void |
startService()
Creates the requested Timer if not already available and start all added Schedules. |
void |
stopSchedules(boolean pDoItNow)
Stops all the sontaining Schedules |
protected void |
stopService()
Stops all available Schedules. |
void |
unregisterProvider(java.lang.String pProviderObjectName)
Unregister a Provider which in turn calls "stopProviding()" indicating to the Provider to remove all the Schedules. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, createService, destroy, getLog, getName, getNextNotificationSequenceNumber, 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 (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String DEFAULT_TIMER_NAME
Constructor Detail |
public ScheduleManager()
Method Detail |
public void startSchedules()
public void stopSchedules(boolean pDoItNow)
pDoItNow
- If true all the schedules are stopped immeditaly otherwise
it waits until the next notification is sentpublic void restartSchedule()
public void registerProvider(java.lang.String pProviderObjectName)
pProviderObjectName
- Object Name of the Providerpublic void unregisterProvider(java.lang.String pProviderObjectName)
pProviderObjectName
- Object Name of the Providerpublic int addSchedule(ObjectName (src) pProvider, ObjectName (src) pTarget, java.lang.String pMethodName, java.lang.String[] pMethodSignature, java.util.Date pStartDate, long pPeriod, int pRepetitions)
pTarget
- Object Name of the Target MBeanpMethodName
- Name of the method to be calledpMethodSignature
- List of Attributes of the method to be called
where ...pStartDate
- Date when the schedule is startedpRepetitions
- Initial Number of repetitions
public void removeSchedule(int pIdentification)
pIdentification
- Identification returned by addSchedule()
or getSchedules()
.public java.lang.String getSchedules()
public boolean isPaused()
public void setPaused(boolean pIsPaused)
pIsPaused
- True when the Schedules are paused or
false when they resumespublic boolean isStarted()
public boolean isStartAtStartup()
public void setStartAtStartup(boolean pStartAtStartup)
startService()
gets called (normally at
startup time.
pStartAtStartup
- True if Schedule has to be started at startup timepublic java.lang.String getTimerName()
public void setTimerName(java.lang.String pTimerName)
pTimerName
- Object Name of the Timer MBean to
be used. If null or not a valid ObjectName
the default will be usedpublic ObjectName (src) getObjectName(MBeanServer (src) pServer, ObjectName (src) pName) throws MalformedObjectNameException (src)
ServiceMBeanSupport (src)
getObjectName
in class ServiceMBeanSupport (src)
MalformedObjectNameException (src)
protected void destroyService()
destroyService
in class ServiceMBeanSupport (src)
protected void startService() throws java.lang.Exception
startService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void stopService()
stopService
in class ServiceMBeanSupport (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |