JBoss API: Interface SchedulerMBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the manageable interface for a Scheduler Service
allowing the client to create a Schedulable instance which is then run
by this service at given times or to use a MBean which is called by this
service at given times.
Attention: You have two ways to specify the Schedulable. Either
you specify a Schedulable Class which is created and used by the Scheduler
or you specify a JMX MBean which the specified method is called. Note that
the last method of setSchedulableClass(java.lang.String)
or setSchedulableMBean(java.lang.String)
defines which one is used. Therefore you should never mixed these two.
Field Summary | |
static java.lang.String |
OBJECT_NAME
|
Fields inherited from interface org.jboss.util.ServiceMBean |
STARTED, STARTING, states, STOPPED, STOPPING |
Method Summary | |
long |
getInitialRepetitions()
|
java.lang.String |
getInitialStartDate()
|
long |
getRemainingRepetitions()
|
java.lang.String |
getSchedulableArguments()
|
java.lang.String |
getSchedulableArgumentTypes()
|
java.lang.String |
getSchedulableClass()
|
java.lang.String |
getSchedulableMBean()
|
java.lang.String |
getSchedulableMBeanMethod()
|
long |
getSchedulePeriod()
|
boolean |
isActive()
|
boolean |
isRestartPending()
|
boolean |
isStartAtStartup()
|
boolean |
isStarted()
|
boolean |
isUsingMBean()
|
void |
restartSchedule()
Stops the server right now and starts it right now. |
void |
setInitialRepetitions(long pNumberOfCalls)
Sets the initial number of scheduled calls. |
void |
setInitialStartDate(java.lang.String pStartDate)
Sets the first scheduled call. |
void |
setSchedulableArguments(java.lang.String pArgumentList)
Sets the comma seperated list of arguments for the Schedulable class. |
void |
setSchedulableArgumentTypes(java.lang.String pTypeList)
Sets the comma seperated list of argument types for the Schedulable class. |
void |
setSchedulableClass(java.lang.String pSchedulableClass)
Sets the fully qualified Class name of the Schedulable Class being called by the Scheduler. |
void |
setSchedulableMBean(java.lang.String pSchedulableMBean)
Sets the fully qualified JMX MBean name of the Schedulable MBean to be called. |
void |
setSchedulableMBeanMethod(java.lang.String pSchedulableMBeanMethod)
Sets the method name to be called on the Schedulable MBean. |
void |
setSchedulePeriod(long pPeriod)
Sets the Schedule Period between two scheduled call. |
void |
setStartAtStartup(boolean pStartAtStartup)
Set the scheduler to start when MBean started or not. |
void |
startSchedule()
Starts the schedule if the schedule is stopped otherwise nothing will happen. |
void |
stopSchedule(boolean pDoItNow)
Stops the schedule because it is either not used anymore or to restart it with new values. |
Methods inherited from interface org.jboss.util.ServiceMBean |
getName, getState, getStateString |
Methods inherited from interface org.jboss.util.Service |
destroy, init, start, stop |
Field Detail |
public static final java.lang.String OBJECT_NAME
Method Detail |
public void startSchedule()
java.security.InvalidParameterException
- If any of the necessary values are not set
or invalid (especially for the Schedulable
class attributes).public void stopSchedule(boolean pDoItNow)
pDoItNow
- If true the schedule will be stopped without waiting for the next
scheduled call otherwise the next call will be performed before
the schedule is stopped.public void restartSchedule()
public java.lang.String getSchedulableClass()
public void setSchedulableClass(java.lang.String pSchedulableClass) throws java.security.InvalidParameterException
setSchedulableArguments(java.lang.String)
and setSchedulableArgumentTypes(java.lang.String)
.pSchedulableClass
- Fully Qualified Schedulable Class.java.security.InvalidParameterException
- If the given value is not a valid class or cannot
be loaded by the Scheduler or is not of instance
Schedulable.public java.lang.String getSchedulableArguments()
public void setSchedulableArguments(java.lang.String pArgumentList)
pArgumentList
- List of arguments used to create the Schedulable intance. If
the list is null or empty then the no-args constructor is used.public java.lang.String getSchedulableArgumentTypes()
public void setSchedulableArgumentTypes(java.lang.String pTypeList) throws java.security.InvalidParameterException
pTypeList
- List of arguments used to create the Schedulable intance. If
the list is null or empty then the no-args constructor is used.java.security.InvalidParameterException
- If the given list contains a unknow datat type.public java.lang.String getSchedulableMBean()
public void setSchedulableMBean(java.lang.String pSchedulableMBean) throws java.security.InvalidParameterException
setSchedulableClass(java.lang.String)
,
setSchedulableArguments(java.lang.String)
and setSchedulableArgumentTypes(java.lang.String)
are
cleared and not used anymore. Therefore only use either Schedulable Class or
Schedulable MBean. If setSchedulableMBeanMethod(java.lang.String)
is not set then the
schedule method as in the Schedulable.perform(java.util.Date, long)
will be called with the
same arguments. Also note that the Object Name will not be checked if the
MBean is available. If the MBean is not available it will not be called but
the remaining repetitions will be decreased.pSchedulableMBean
- JMX MBean Object Name which should be called.java.security.InvalidParameterException
- If the given value is an valid Object Name.public java.lang.String getSchedulableMBeanMethod()
public void setSchedulableMBeanMethod(java.lang.String pSchedulableMBeanMethod) throws java.security.InvalidParameterException
pSchedulableMBeanMethod
- Name of the method to be called optional followed
by method arguments (see above).java.security.InvalidParameterException
- If the given value is not of the right
formatpublic boolean isUsingMBean()
public long getSchedulePeriod()
public void setSchedulePeriod(long pPeriod)
pPeriod
- Time between to scheduled calls (after the initial call) in Milliseconds.
This value must be bigger than 0.java.security.InvalidParameterException
- If the given value is less or equal than 0public java.lang.String getInitialStartDate()
setInitialStartDate()
method.public void setInitialStartDate(java.lang.String pStartDate)
pStartDate
- Date when the initial call is scheduled. It can be either:
public long getInitialRepetitions()
public void setInitialRepetitions(long pNumberOfCalls)
pNumberOfCalls
- Initial Number of scheduled calls. If -1 then the number
is unlimted.java.security.InvalidParameterException
- If the given value is less or equal than 0public long getRemainingRepetitions()
public boolean isStarted()
public boolean isRestartPending()
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 boolean isActive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |