public interface Scheduler
This is the main interface of a Quartz Scheduler.
A Scheduler maintains a registery of
s and JobDetails. Once registered, the TriggerScheduler
is responible for executing Job s when their associated
Trigger s fire (when their scheduled time arrives).
Scheduler instances are produced by a .
A scheduler that has already been created/initialized can be found and used
through the same factory that produced it. After a SchedulerFactoryScheduler
has been created, it is in "stand-by" mode, and must have its
start() method called before it will fire any Jobs.
Job s are to be created by the 'client program', by defining
a class that implements the
interface. Job objects are then created (also
by the client) to define a individual instances of the JobDetailJob.
JobDetail instances can then be registered with the Scheduler
via the scheduleJob(JobDetail, Trigger) or addJob(JobDetail, boolean)
method.
Trigger s can then be defined to fire individual Job
instances based on given schedules. SimpleTrigger s are most
useful for one-time firings, or firing at an exact moment in time, with N
repeats with a given delay between them. CronTrigger s allow
scheduling based on time of day, day of week, day of month, and month of
year.
Job s and Trigger s have a name and group
associated with them, which should uniquely identify them within a single
. The 'group' feature may be useful for
creating logical groupings or categorizations of SchedulerJobs s and
Triggerss. If you don't have need for assigning a group to a
given Jobs of Triggers, then you can use the
DEFAULT_GROUP constant defined on this interface.
Stored Job s can also be 'manually' triggered through the use
of the triggerJob(String jobName, String jobGroup) function.
Client programs may also be interested in the 'listener' interfaces that are
available from Quartz. The interface
provides notifications of JobListenerJob executions. The
interface provides notifications of TriggerListenerTrigger firings. The
interface provides notifications of
SchedulerListenerScheduler events and errors.
The setup/configuration of a Scheduler instance is very
customizable. Please consult the documentation distributed with Quartz.
Job,
JobDetail,
Trigger,
JobListener,
TriggerListener,
SchedulerListener| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_FAIL_OVER_GROUP
A constant
Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("FAILED_OVER_JOBS") for the name of a Trigger's group. |
static java.lang.String |
DEFAULT_GROUP
A (possibly) usefull constant that can be used for specifying the group
that
Job and Trigger instances belong to. |
static java.lang.String |
DEFAULT_MANUAL_TRIGGERS
A constant
Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("MANUAL_TRIGGER") for the name of a Trigger's group. |
static java.lang.String |
DEFAULT_RECOVERY_GROUP
A constant
Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("RECOVERING_JOBS") for the name of a Trigger's group. |
static java.lang.String |
FAILED_JOB_ORIGINAL_TRIGGER_FIRETIME_IN_MILLISECONDS
A constant
JobDataMap key that can be used to retrieve the
scheduled fire time of the original Trigger from a recovery
trigger's data map in the case of a job recovering after a failed scheduler
instance. |
static java.lang.String |
FAILED_JOB_ORIGINAL_TRIGGER_GROUP
A constant
JobDataMap key that can be used to retrieve the
group of the original Trigger from a recovery trigger's
data map in the case of a job recovering after a failed scheduler
instance. |
static java.lang.String |
FAILED_JOB_ORIGINAL_TRIGGER_NAME
A constant
JobDataMap key that can be used to retrieve the
name of the original Trigger from a recovery trigger's
data map in the case of a job recovering after a failed scheduler
instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCalendar(java.lang.String calName,
Calendar calendar,
boolean replace,
boolean updateTriggers)
Add (register) the given
Calendar to the Scheduler. |
void |
addGlobalJobListener(JobListener jobListener)
Add the given
to the Scheduler's
global list. |
void |
addGlobalTriggerListener(TriggerListener triggerListener)
Add the given
to the Scheduler's
global list. |
void |
addJob(JobDetail jobDetail,
boolean replace)
Add the given
Job to the Scheduler - with no associated
Trigger. |
void |
addJobListener(JobListener jobListener)
|
void |
addSchedulerListener(SchedulerListener schedulerListener)
Register the given
with the
Scheduler. |
void |
addTriggerListener(TriggerListener triggerListener)
|
boolean |
deleteCalendar(java.lang.String calName)
Delete the identified
Calendar from the Scheduler. |
boolean |
deleteJob(java.lang.String jobName,
java.lang.String groupName)
Delete the identified
Job from the Scheduler - and any
associated Triggers. |
Calendar |
getCalendar(java.lang.String calName)
Get the
instance with the given name. |
java.lang.String[] |
getCalendarNames()
Get the names of all registered
. |
SchedulerContext |
getContext()
Returns the
SchedulerContext of the Scheduler. |
java.util.List |
getCurrentlyExecutingJobs()
Return a list of
JobExecutionContext objects that
represent all currently executing Jobs in this Scheduler instance. |
JobListener |
getGlobalJobListener(java.lang.String name)
Get the global
that has
the given name. |
java.util.List |
getGlobalJobListeners()
Get a List containing all of the
s in
the Scheduler'sglobal list. |
TriggerListener |
getGlobalTriggerListener(java.lang.String name)
Get the global
that
has the given name. |
java.util.List |
getGlobalTriggerListeners()
Get a List containing all of the
s in the Scheduler'sglobal list. |
JobDetail |
getJobDetail(java.lang.String jobName,
java.lang.String jobGroup)
Get the
for the Job
instance with the given name and group. |
java.lang.String[] |
getJobGroupNames()
Get the names of all known
groups. |
JobListener |
getJobListener(java.lang.String name)
Get the non-global
that has
the given name. |
java.util.Set |
getJobListenerNames()
Get a Set containing the names of all the non-global
s registered with the Scheduler. |
java.lang.String[] |
getJobNames(java.lang.String groupName)
Get the names of all the
in the given group. |
SchedulerMetaData |
getMetaData()
Get a
SchedulerMetaData object describiing the settings
and capabilities of the scheduler instance. |
java.util.Set |
getPausedTriggerGroups()
Get the names of all
groups that are paused. |
java.lang.String |
getSchedulerInstanceId()
Returns the instance Id of the
Scheduler. |
java.util.List |
getSchedulerListeners()
Get a List containing all of the
s registered with the Scheduler. |
java.lang.String |
getSchedulerName()
Returns the name of the
Scheduler. |
Trigger |
getTrigger(java.lang.String triggerName,
java.lang.String triggerGroup)
Get the
instance with the given name and
group. |
java.lang.String[] |
getTriggerGroupNames()
Get the names of all known
groups. |
TriggerListener |
getTriggerListener(java.lang.String name)
Get the non-global
that
has the given name. |
java.util.Set |
getTriggerListenerNames()
Get a Set containing the names of all the non-global
s registered with the Scheduler. |
java.lang.String[] |
getTriggerNames(java.lang.String groupName)
Get the names of all the
in the given
group. |
Trigger[] |
getTriggersOfJob(java.lang.String jobName,
java.lang.String groupName)
|
int |
getTriggerState(java.lang.String triggerName,
java.lang.String triggerGroup)
Get the current state of the identified
. |
boolean |
interrupt(java.lang.String jobName,
java.lang.String groupName)
Request the interruption, within this Scheduler instance, of all
currently executing instances of the identified
Job, which
must be an implementor of the InterruptableJob interface. |
boolean |
isInStandbyMode()
Reports whether the
Scheduler is in stand-by mode. |
boolean |
isPaused()
Deprecated.
|
boolean |
isShutdown()
Reports whether the
Scheduler has been shutdown. |
boolean |
isStarted()
Whether the scheduler has been started.
|
void |
pause()
Deprecated.
replaced by better-named standby() method.
|
void |
pauseAll()
Pause all triggers - similar to calling
pauseTriggerGroup(group)
on every group, however, after using this method resumeAll()
must be called to clear the scheduler's state of 'remembering' that all
new triggers will be paused as they are added. |
void |
pauseJob(java.lang.String jobName,
java.lang.String groupName)
Pause the
with the given
name - by pausing all of its current Triggers. |
void |
pauseJobGroup(java.lang.String groupName)
Pause all of the
in the
given group - by pausing all of their Triggers. |
void |
pauseTrigger(java.lang.String triggerName,
java.lang.String groupName)
Pause the
with the given name. |
void |
pauseTriggerGroup(java.lang.String groupName)
Pause all of the
in the given group. |
boolean |
removeGlobalJobListener(JobListener jobListener)
Deprecated.
|
boolean |
removeGlobalJobListener(java.lang.String name)
Remove the identifed
from the Scheduler's
list of global listeners. |
boolean |
removeGlobalTriggerListener(java.lang.String name)
Remove the identifed
from the Scheduler's
list of global listeners. |
boolean |
removeGlobalTriggerListener(TriggerListener triggerListener)
Deprecated.
|
boolean |
removeJobListener(java.lang.String name)
Remove the identifed
from the Scheduler's
list of registered listeners. |
boolean |
removeSchedulerListener(SchedulerListener schedulerListener)
Remove the given
from the
Scheduler. |
boolean |
removeTriggerListener(java.lang.String name)
Remove the identifed
from the
Scheduler's list of registered listeners. |
java.util.Date |
rescheduleJob(java.lang.String triggerName,
java.lang.String groupName,
Trigger newTrigger)
Remove (delete) the
with the
given name, and store the new given one - which must be associated
with the same job (the new trigger must have the job name & group specified)
- however, the new trigger need not have the same name as the old trigger. |
void |
resumeAll()
Resume (un-pause) all triggers - similar to calling
resumeTriggerGroup(group) on every group. |
void |
resumeJob(java.lang.String jobName,
java.lang.String groupName)
Resume (un-pause) the
with
the given name. |
void |
resumeJobGroup(java.lang.String groupName)
Resume (un-pause) all of the
in the given group. |
void |
resumeTrigger(java.lang.String triggerName,
java.lang.String groupName)
Resume (un-pause) the
with the given
name. |
void |
resumeTriggerGroup(java.lang.String groupName)
Resume (un-pause) all of the
in the
given group. |
java.util.Date |
scheduleJob(JobDetail jobDetail,
Trigger trigger)
|
java.util.Date |
scheduleJob(Trigger trigger)
|
void |
setJobFactory(JobFactory factory)
Set the
JobFactory that will be responsible for producing
instances of Job classes. |
void |
shutdown()
Halts the
Scheduler's firing of ,
and cleans up all resources associated with the Scheduler. |
void |
shutdown(boolean waitForJobsToComplete)
Halts the
Scheduler's firing of ,
and cleans up all resources associated with the Scheduler. |
void |
standby()
Temporarily halts the
Scheduler's firing of . |
void |
start()
Starts the
Scheduler's threads that fire . |
void |
startDelayed(int seconds)
Calls {#start()} after the indicated number of seconds.
|
void |
triggerJob(java.lang.String jobName,
java.lang.String groupName)
Trigger the identified
(execute it now) - the generated trigger will be non-volatile. |
void |
triggerJob(java.lang.String jobName,
java.lang.String groupName,
JobDataMap data)
Trigger the identified
(execute it now) - the generated trigger will be non-volatile. |
void |
triggerJobWithVolatileTrigger(java.lang.String jobName,
java.lang.String groupName)
Trigger the identified
(execute it now) - the generated trigger will be volatile. |
void |
triggerJobWithVolatileTrigger(java.lang.String jobName,
java.lang.String groupName,
JobDataMap data)
Trigger the identified
(execute it now) - the generated trigger will be volatile. |
boolean |
unscheduleJob(java.lang.String triggerName,
java.lang.String groupName)
Remove the indicated
from the scheduler. |
static final java.lang.String DEFAULT_GROUP
A (possibly) usefull constant that can be used for specifying the group
that Job and Trigger instances belong to.
static final java.lang.String DEFAULT_MANUAL_TRIGGERS
A constant Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("MANUAL_TRIGGER") for the name of a Trigger's group.
static final java.lang.String DEFAULT_RECOVERY_GROUP
A constant Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("RECOVERING_JOBS") for the name of a Trigger's group.
static final java.lang.String DEFAULT_FAIL_OVER_GROUP
A constant Trigger group name used internally by the
scheduler - clients should not use the value of this constant
("FAILED_OVER_JOBS") for the name of a Trigger's group.
static final java.lang.String FAILED_JOB_ORIGINAL_TRIGGER_NAME
JobDataMap key that can be used to retrieve the
name of the original Trigger from a recovery trigger's
data map in the case of a job recovering after a failed scheduler
instance.static final java.lang.String FAILED_JOB_ORIGINAL_TRIGGER_GROUP
JobDataMap key that can be used to retrieve the
group of the original Trigger from a recovery trigger's
data map in the case of a job recovering after a failed scheduler
instance.static final java.lang.String FAILED_JOB_ORIGINAL_TRIGGER_FIRETIME_IN_MILLISECONDS
JobDataMap key that can be used to retrieve the
scheduled fire time of the original Trigger from a recovery
trigger's data map in the case of a job recovering after a failed scheduler
instance.java.lang.String getSchedulerName()
throws SchedulerException
Returns the name of the Scheduler.
SchedulerExceptionjava.lang.String getSchedulerInstanceId()
throws SchedulerException
Returns the instance Id of the Scheduler.
SchedulerExceptionSchedulerContext getContext() throws SchedulerException
Returns the SchedulerContext of the Scheduler.
SchedulerExceptionvoid start()
throws SchedulerException
Starts the Scheduler's threads that fire .
When a scheduler is first created it is in "stand-by" mode, and will not
fire triggers. The scheduler can also be put into stand-by mode by
calling the Triggersstandby() method.
The misfire/recovery process will be started, if it is the initial call to this method on this scheduler instance.
SchedulerException - if shutdown() has been called, or there is an
error within the Scheduler.startDelayed(int),
standby(),
shutdown()void startDelayed(int seconds)
throws SchedulerException
Calls {#start()} after the indicated number of seconds. (This call does not block). This can be useful within applications that have initializers that create the scheduler immediately, before the resources needed by the executing jobs have been fully initialized.
SchedulerException - if shutdown() has been called, or there is an
error within the Scheduler.start(),
standby(),
shutdown()boolean isStarted()
throws SchedulerException
Note: This only reflects whether has ever
been called on this Scheduler, so it will return start()true even
if the Scheduler is currently in standby mode or has been
since shutdown.
SchedulerExceptionstart(),
isShutdown(),
isInStandbyMode()void standby()
throws SchedulerException
Temporarily halts the Scheduler's firing of .
Triggers
When start() is called (to bring the scheduler out of
stand-by mode), trigger misfire instructions will NOT be applied
during the execution of the start() method - any misfires
will be detected immediately afterward (by the JobStore's
normal process).
The scheduler is not destroyed, and can be re-started at any time.
SchedulerExceptionstart(),
pauseAll()void pause()
throws SchedulerException
SchedulerExceptionstandby()boolean isInStandbyMode()
throws SchedulerException
Reports whether the Scheduler is in stand-by mode.
SchedulerExceptionstandby(),
start()boolean isPaused()
throws SchedulerException
SchedulerExceptionisInStandbyMode()void shutdown()
throws SchedulerException
Halts the Scheduler's firing of ,
and cleans up all resources associated with the Scheduler. Equivalent to
Triggersshutdown(false).
The scheduler cannot be re-started.
SchedulerExceptionshutdown(boolean)void shutdown(boolean waitForJobsToComplete)
throws SchedulerException
Halts the Scheduler's firing of ,
and cleans up all resources associated with the Scheduler.
Triggers
The scheduler cannot be re-started.
waitForJobsToComplete - if true the scheduler will not allow this method
to return until all currently executing jobs have completed.SchedulerExceptionshutdown()boolean isShutdown()
throws SchedulerException
Reports whether the Scheduler has been shutdown.
SchedulerExceptionSchedulerMetaData getMetaData() throws SchedulerException
Get a SchedulerMetaData object describiing the settings
and capabilities of the scheduler instance.
Note that the data returned is an 'instantaneous' snap-shot, and that as soon as it's returned, the meta data values may be different.
SchedulerExceptionjava.util.List getCurrentlyExecutingJobs()
throws SchedulerException
Return a list of JobExecutionContext objects that
represent all currently executing Jobs in this Scheduler instance.
This method is not cluster aware. That is, it will only return Jobs currently executing in this Scheduler instance, not across the entire cluster.
Note that the list returned is an 'instantaneous' snap-shot, and that as
soon as it's returned, the true list of executing jobs may be different.
Also please read the doc associated with JobExecutionContext-
especially if you're using RMI.
SchedulerExceptionJobExecutionContextvoid setJobFactory(JobFactory factory) throws SchedulerException
Set the JobFactory that will be responsible for producing
instances of Job classes.
JobFactories may be of use to those wishing to have their application
produce Job instances via some special mechanism, such as to
give the opertunity for dependency injection.
SchedulerExceptionJobFactoryjava.util.Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException
Add the given to the
Scheduler, and associate the given JobDetail with
it.
Trigger
If the given Trigger does not reference any Job, then it
will be set to reference the Job passed with it into this method.
SchedulerException - if the Job or Trigger cannot be added to the Scheduler, or
there is an internal Scheduler error.java.util.Date scheduleJob(Trigger trigger) throws SchedulerException
Schedule the given with the
TriggerJob identified by the Trigger's settings.
SchedulerException - if the indicated Job does not exist, or the Trigger cannot be
added to the Scheduler, or there is an internal Scheduler
error.boolean unscheduleJob(java.lang.String triggerName,
java.lang.String groupName)
throws SchedulerException
Remove the indicated from the scheduler.
Trigger
SchedulerExceptionjava.util.Date rescheduleJob(java.lang.String triggerName,
java.lang.String groupName,
Trigger newTrigger)
throws SchedulerException
Remove (delete) the with the
given name, and store the new given one - which must be associated
with the same job (the new trigger must have the job name & group specified)
- however, the new trigger need not have the same name as the old trigger.
Trigger
triggerName - The name of the Trigger to be replaced.groupName - The group name of the Trigger to be replaced.newTrigger - The new Trigger to be stored.null if a Trigger with the given
name & group was not found and removed from the store, otherwise
the first fire time of the newly scheduled trigger.SchedulerExceptionvoid addJob(JobDetail jobDetail, boolean replace) throws SchedulerException
Add the given Job to the Scheduler - with no associated
Trigger. The Job will be 'dormant' until
it is scheduled with a Trigger, or Scheduler.triggerJob()
is called for it.
The Job must by definition be 'durable', if it is not,
SchedulerException will be thrown.
SchedulerException - if there is an internal Scheduler error, or if the Job is not
durable, or a Job with the same name already exists, and
replace is false.boolean deleteJob(java.lang.String jobName,
java.lang.String groupName)
throws SchedulerException
Delete the identified Job from the Scheduler - and any
associated Triggers.
SchedulerException - if there is an internal Scheduler error.void triggerJob(java.lang.String jobName,
java.lang.String groupName)
throws SchedulerException
Trigger the identified
(execute it now) - the generated trigger will be non-volatile.
JobDetail
SchedulerExceptionvoid triggerJobWithVolatileTrigger(java.lang.String jobName,
java.lang.String groupName)
throws SchedulerException
Trigger the identified
(execute it now) - the generated trigger will be volatile.
JobDetail
SchedulerExceptionvoid triggerJob(java.lang.String jobName,
java.lang.String groupName,
JobDataMap data)
throws SchedulerException
Trigger the identified
(execute it now) - the generated trigger will be non-volatile.
JobDetail
jobName - the name of the Job to triggergroupName - the group name of the Job to triggerdata - the (possibly null) JobDataMap to be
associated with the trigger that fires the job immediately.SchedulerExceptionvoid triggerJobWithVolatileTrigger(java.lang.String jobName,
java.lang.String groupName,
JobDataMap data)
throws SchedulerException
Trigger the identified
(execute it now) - the generated trigger will be volatile.
JobDetail
jobName - the name of the Job to triggergroupName - the group name of the Job to triggerdata - the (possibly null) JobDataMap to be
associated with the trigger that fires the job immediately.SchedulerExceptionvoid pauseJob(java.lang.String jobName,
java.lang.String groupName)
throws SchedulerException
Pause the with the given
name - by pausing all of its current JobDetailTriggers.
SchedulerExceptionresumeJob(String, String)void pauseJobGroup(java.lang.String groupName)
throws SchedulerException
Pause all of the in the
given group - by pausing all of their JobDetailsTriggers.
The Scheduler will "remember" that the group is paused, and impose the pause on any new jobs that are added to the group while the group is paused.
SchedulerExceptionresumeJobGroup(String)void pauseTrigger(java.lang.String triggerName,
java.lang.String groupName)
throws SchedulerException
Pause the with the given name.
Trigger
SchedulerExceptionresumeTrigger(String, String)void pauseTriggerGroup(java.lang.String groupName)
throws SchedulerException
Pause all of the in the given group.
Triggers
The Scheduler will "remember" that the group is paused, and impose the pause on any new triggers that are added to the group while the group is paused.
SchedulerExceptionresumeTriggerGroup(String)void resumeJob(java.lang.String jobName,
java.lang.String groupName)
throws SchedulerException
Resume (un-pause) the with
the given name.
JobDetail
If any of the Job'sTrigger s missed one
or more fire-times, then the Trigger's misfire
instruction will be applied.
SchedulerExceptionpauseJob(String, String)void resumeJobGroup(java.lang.String groupName)
throws SchedulerException
Resume (un-pause) all of the
in the given group.
JobDetails
If any of the Job s had Trigger s that
missed one or more fire-times, then the Trigger's
misfire instruction will be applied.
SchedulerExceptionpauseJobGroup(String)void resumeTrigger(java.lang.String triggerName,
java.lang.String groupName)
throws SchedulerException
Resume (un-pause) the with the given
name.
Trigger
If the Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
SchedulerExceptionpauseTrigger(String, String)void resumeTriggerGroup(java.lang.String groupName)
throws SchedulerException
Resume (un-pause) all of the in the
given group.
Triggers
If any Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
SchedulerExceptionpauseTriggerGroup(String)void pauseAll()
throws SchedulerException
Pause all triggers - similar to calling pauseTriggerGroup(group)
on every group, however, after using this method resumeAll()
must be called to clear the scheduler's state of 'remembering' that all
new triggers will be paused as they are added.
When resumeAll() is called (to un-pause), trigger misfire
instructions WILL be applied.
SchedulerExceptionresumeAll(),
pauseTriggerGroup(String),
standby()void resumeAll()
throws SchedulerException
Resume (un-pause) all triggers - similar to calling
resumeTriggerGroup(group) on every group.
If any Trigger missed one or more fire-times, then the
Trigger's misfire instruction will be applied.
SchedulerExceptionpauseAll()java.lang.String[] getJobGroupNames()
throws SchedulerException
Get the names of all known
groups.
JobDetail
SchedulerExceptionjava.lang.String[] getJobNames(java.lang.String groupName)
throws SchedulerException
Get the names of all the
in the given group.
JobDetails
SchedulerExceptionTrigger[] getTriggersOfJob(java.lang.String jobName, java.lang.String groupName) throws SchedulerException
SchedulerExceptionjava.lang.String[] getTriggerGroupNames()
throws SchedulerException
Get the names of all known groups.
Trigger
SchedulerExceptionjava.lang.String[] getTriggerNames(java.lang.String groupName)
throws SchedulerException
Get the names of all the in the given
group.
Triggers
SchedulerExceptionjava.util.Set getPausedTriggerGroups()
throws SchedulerException
Get the names of all groups that are paused.
Trigger
SchedulerExceptionJobDetail getJobDetail(java.lang.String jobName, java.lang.String jobGroup) throws SchedulerException
Get the for the JobDetailJob
instance with the given name and group.
SchedulerExceptionTrigger getTrigger(java.lang.String triggerName, java.lang.String triggerGroup) throws SchedulerException
Get the instance with the given name and
group.
Trigger
SchedulerExceptionint getTriggerState(java.lang.String triggerName,
java.lang.String triggerGroup)
throws SchedulerException
Get the current state of the identified .
Trigger
void addCalendar(java.lang.String calName,
Calendar calendar,
boolean replace,
boolean updateTriggers)
throws SchedulerException
Add (register) the given Calendar to the Scheduler.
updateTriggers - whether or not to update existing triggers that
referenced the already existing calendar so that they are 'correct'
based on the new trigger.SchedulerException - if there is an internal Scheduler error, or a Calendar with
the same name already exists, and replace is
false.boolean deleteCalendar(java.lang.String calName)
throws SchedulerException
Delete the identified Calendar from the Scheduler.
SchedulerException - if there is an internal Scheduler error.Calendar getCalendar(java.lang.String calName) throws SchedulerException
Get the instance with the given name.
Calendar
SchedulerExceptionjava.lang.String[] getCalendarNames()
throws SchedulerException
Get the names of all registered .
Calendars
SchedulerExceptionboolean interrupt(java.lang.String jobName,
java.lang.String groupName)
throws UnableToInterruptJobException
Request the interruption, within this Scheduler instance, of all
currently executing instances of the identified Job, which
must be an implementor of the InterruptableJob interface.
If more than one instance of the identified job is currently executing,
the InterruptableJob#interrupt() method will be called on
each instance. However, there is a limitation that in the case that
interrupt() on one instances throws an exception, all
remaining instances (that have not yet been interrupted) will not have
their interrupt() method called.
If you wish to interrupt a specific instance of a job (when more than
one is executing) you can do so by calling
to obtain a handle
to the job instance, and then invoke getCurrentlyExecutingJobs()interrupt() on it
yourself.
This method is not cluster aware. That is, it will only interrupt instances of the identified InterruptableJob currently executing in this Scheduler instance, not across the entire cluster.
jobName - groupName - UnableToInterruptJobException - if the job does not implement
InterruptableJob, or there is an exception while
interrupting the job.InterruptableJob.interrupt(),
getCurrentlyExecutingJobs()void addGlobalJobListener(JobListener jobListener) throws SchedulerException
Add the given to the JobListenerScheduler's
global list.
Listeners in the 'global' list receive notification of execution events
for ALL s.
JobDetail
SchedulerExceptionvoid addJobListener(JobListener jobListener) throws SchedulerException
Add the given to the JobListenerScheduler's
list, of registered JobListeners.
SchedulerExceptionboolean removeGlobalJobListener(JobListener jobListener) throws SchedulerException
removeGlobalJobListener(String)
Remove the given from the JobListenerScheduler's
list of global listeners.
SchedulerExceptionboolean removeGlobalJobListener(java.lang.String name)
throws SchedulerException
Remove the identifed from the JobListenerScheduler's
list of global listeners.
SchedulerExceptionboolean removeJobListener(java.lang.String name)
throws SchedulerException
Remove the identifed from the JobListenerScheduler's
list of registered listeners.
SchedulerExceptionjava.util.List getGlobalJobListeners()
throws SchedulerException
Get a List containing all of the s in
the JobListenerScheduler'sglobal list.
SchedulerExceptionjava.util.Set getJobListenerNames()
throws SchedulerException
Get a Set containing the names of all the non-global
s registered with the JobListenerScheduler.
SchedulerExceptionJobListener getGlobalJobListener(java.lang.String name) throws SchedulerException
Get the global that has
the given name.
JobListener
SchedulerExceptionJobListener getJobListener(java.lang.String name) throws SchedulerException
Get the non-global that has
the given name.
JobListener
SchedulerExceptionvoid addGlobalTriggerListener(TriggerListener triggerListener) throws SchedulerException
Add the given to the TriggerListenerScheduler's
global list.
Listeners in the 'global' list receive notification of execution events
for ALL s.
Trigger
SchedulerExceptionvoid addTriggerListener(TriggerListener triggerListener) throws SchedulerException
Add the given to the TriggerListenerScheduler's
list, of registered TriggerListeners.
SchedulerExceptionboolean removeGlobalTriggerListener(TriggerListener triggerListener) throws SchedulerException
removeGlobalTriggerListener(String)
Remove the given from the TriggerListenerScheduler's
list of global listeners.
SchedulerExceptionboolean removeGlobalTriggerListener(java.lang.String name)
throws SchedulerException
Remove the identifed from the TriggerListenerScheduler's
list of global listeners.
SchedulerExceptionboolean removeTriggerListener(java.lang.String name)
throws SchedulerException
Remove the identifed from the
TriggerListenerScheduler's list of registered listeners.
SchedulerExceptionjava.util.List getGlobalTriggerListeners()
throws SchedulerException
Get a List containing all of the
s in the TriggerListenerScheduler'sglobal list.
SchedulerExceptionjava.util.Set getTriggerListenerNames()
throws SchedulerException
Get a Set containing the names of all the non-global
s registered with the TriggerListenerScheduler.
SchedulerExceptionTriggerListener getGlobalTriggerListener(java.lang.String name) throws SchedulerException
Get the global that
has the given name.
TriggerListener
SchedulerExceptionTriggerListener getTriggerListener(java.lang.String name) throws SchedulerException
Get the non-global that
has the given name.
TriggerListener
SchedulerExceptionvoid addSchedulerListener(SchedulerListener schedulerListener) throws SchedulerException
Register the given with the
SchedulerListenerScheduler.
SchedulerExceptionboolean removeSchedulerListener(SchedulerListener schedulerListener) throws SchedulerException
Remove the given from the
SchedulerListenerScheduler.
SchedulerExceptionjava.util.List getSchedulerListeners()
throws SchedulerException
Get a List containing all of the
s registered with the SchedulerListenerScheduler.
SchedulerException