Scheduler (Quartz Parent POM 2.0.1 API)

Quartz Java



org.quartz Interface Scheduler

All Known Implementing Classes:
JBoss4RMIRemoteMBeanScheduler, RemoteMBeanScheduler, RemoteScheduler, StdScheduler

public interface Scheduler

This is the main interface of a Quartz Scheduler.

A Scheduler maintains a registry of JobDetails and Triggers. Once registered, the Scheduler is responsible for executing Job s when their associated Trigger s fire (when their scheduled time arrives).

Scheduler instances are produced by a SchedulerFactory. A scheduler that has already been created/initialized can be found and used through the same factory that produced it. After a Scheduler 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 Job interface. JobDetail objects are then created (also by the client) to define a individual instances of the Job. 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 Scheduler. The 'group' feature may be useful for creating logical groupings or categorizations of Jobs 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 JobListener interface provides notifications of Job executions. The TriggerListener interface provides notifications of Trigger firings. The SchedulerListener interface provides notifications of Scheduler events and errors. Listeners can be associated with local schedulers through the ListenerManager interface.

The setup/configuration of a Scheduler instance is very customizable. Please consult the documentation distributed with Quartz.

Author:
James House, Sharada Jambula
See Also:
Job, JobDetail, JobBuilder, Trigger, TriggerBuilder, , JobListener, TriggerListener, SchedulerListener

Field Summary
static 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 String DEFAULT_GROUP
          A (possibly) useful constant that can be used for specifying the group that Job and Trigger instances belong to.
static 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 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 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 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.
 
Method Summary
 void addCalendar(String calName, Calendar calendar, boolean replace, boolean updateTriggers)
          Add (register) the given Calendar to the Scheduler.
 void addJob(JobDetail jobDetail, boolean replace)
          Add the given Job to the Scheduler - with no associated Trigger.
 boolean checkExists(JobKey jobKey)
          Determine whether a Job with the given identifier already exists within the scheduler.
 boolean checkExists(TriggerKey triggerKey)
          Determine whether a Trigger with the given identifier already exists within the scheduler.
 void clear()
          Clears (deletes!) all scheduling data - all Jobs, Triggers Calendars.
 boolean deleteCalendar(String calName)
          Delete the identified Calendar from the Scheduler.
 boolean deleteJob(JobKey jobKey)
          Delete the identified Job from the Scheduler - and any associated Triggers.
 boolean deleteJobs(List<JobKey> jobKeys)
          Delete the identified Jobs from the Scheduler - and any associated Triggers.
 Calendar getCalendar(String calName)
          Get the Calendar instance with the given name.
 List<String> getCalendarNames()
          Get the names of all registered Calendars.
 SchedulerContext getContext()
          Returns the SchedulerContext of the Scheduler.
 List<JobExecutionContext> getCurrentlyExecutingJobs()
          Return a list of JobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance.
 JobDetail getJobDetail(JobKey jobKey)
          Get the JobDetail for the Job instance with the given key.
 List<String> getJobGroupNames()
          Get the names of all known JobDetail groups.
 Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
          Get the keys of all the JobDetails in the matching groups.
 ListenerManager getListenerManager()
          Get a reference to the scheduler's ListenerManager, through which listeners may be registered.
 SchedulerMetaData getMetaData()
          Get a SchedulerMetaData object describing the settings and capabilities of the scheduler instance.
 Set<String> getPausedTriggerGroups()
          Get the names of all Trigger groups that are paused.
 String getSchedulerInstanceId()
          Returns the instance Id of the Scheduler.
 String getSchedulerName()
          Returns the name of the Scheduler.
 Trigger getTrigger(TriggerKey triggerKey)
          Get the Trigger instance with the given key.
 List<String> getTriggerGroupNames()
          Get the names of all known Trigger groups.
 Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
          Get the names of all the Triggers in the given group.
 List<? extends Trigger> getTriggersOfJob(JobKey jobKey)
          Get all Trigger s that are associated with the identified JobDetail.
 Trigger.TriggerState getTriggerState(TriggerKey triggerKey)
          Get the current state of the identified Trigger.
 boolean interrupt(JobKey jobKey)
          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 isShutdown()
          Reports whether the Scheduler has been shutdown.
 boolean isStarted()
          Whether the scheduler has been started.
 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(JobKey jobKey)
          Pause the JobDetail with the given key - by pausing all of its current Triggers.
 void pauseJobs(GroupMatcher<JobKey> matcher)
          Pause all of the JobDetails in the matching groups - by pausing all of their Triggers.
 void pauseTrigger(TriggerKey triggerKey)
          Pause the Trigger with the given key.
 void pauseTriggers(GroupMatcher<TriggerKey> matcher)
          Pause all of the Triggers in the groups matching.
 Date rescheduleJob(TriggerKey triggerKey, Trigger newTrigger)
          Remove (delete) the Trigger with the given key, 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(JobKey jobKey)
          Resume (un-pause) the JobDetail with the given key.
 void resumeJobs(GroupMatcher<JobKey> matcher)
          Resume (un-pause) all of the JobDetails in matching groups.
 void resumeTrigger(TriggerKey triggerKey)
          Resume (un-pause) the Trigger with the given key.
 void resumeTriggers(GroupMatcher<TriggerKey> matcher)
          Resume (un-pause) all of the Triggers in matching groups.
 Date scheduleJob(JobDetail jobDetail, Trigger trigger)
          Add the given JobDetail to the Scheduler, and associate the given Trigger with it.
 Date scheduleJob(Trigger trigger)
          Schedule the given Trigger with the Job identified by the Trigger's settings.
 void scheduleJobs(Map<JobDetail,List<Trigger>> triggersAndJobs, boolean replace)
          Schedule all of the given jobs with the related set of triggers.
 void setJobFactory(org.quartz.spi.JobFactory factory)
          Set the JobFactory that will be responsible for producing instances of Job classes.
 void shutdown()
          Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.
 void shutdown(boolean waitForJobsToComplete)
          Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.
 void standby()
          Temporarily halts the Scheduler's firing of Triggers.
 void start()
          Starts the Scheduler's threads that fire Triggers.
 void startDelayed(int seconds)
          Calls {#start()} after the indicated number of seconds.
 void triggerJob(JobKey jobKey)
          Trigger the identified JobDetail (execute it now).
 void triggerJob(JobKey jobKey, JobDataMap data)
          Trigger the identified JobDetail (execute it now).
 boolean unscheduleJob(TriggerKey triggerKey)
          Remove the indicated Trigger from the scheduler.
 boolean unscheduleJobs(List<TriggerKey> triggerKeys)
          Remove all of the indicated Triggers from the scheduler.
 

Field Detail

DEFAULT_GROUP

static final String DEFAULT_GROUP
A (possibly) useful constant that can be used for specifying the group that Job and Trigger instances belong to.

See Also:
Constant Field Values


DEFAULT_RECOVERY_GROUP

static final 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.

See Also:
JobDetail.requestsRecovery(), Constant Field Values


DEFAULT_FAIL_OVER_GROUP

static final 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.

See Also:
JobDetail.requestsRecovery(), Constant Field Values


FAILED_JOB_ORIGINAL_TRIGGER_NAME

static final 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.

See Also:
JobDetail.requestsRecovery(), Constant Field Values


FAILED_JOB_ORIGINAL_TRIGGER_GROUP

static final 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.

See Also:
JobDetail.requestsRecovery(), Constant Field Values


FAILED_JOB_ORIGINAL_TRIGGER_FIRETIME_IN_MILLISECONDS

static final 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.

See Also:
JobDetail.requestsRecovery(), Constant Field Values

Method Detail

getSchedulerName

String getSchedulerName()
                        throws SchedulerException
Returns the name of the Scheduler.

Throws:
SchedulerException

getSchedulerInstanceId

String getSchedulerInstanceId()
                              throws SchedulerException
Returns the instance Id of the Scheduler.

Throws:
SchedulerException

getContext

SchedulerContext getContext()
                            throws SchedulerException
Returns the SchedulerContext of the Scheduler.

Throws:
SchedulerException

start

void start()
           throws SchedulerException
Starts the Scheduler's threads that fire Triggers. 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 standby() method.

The misfire/recovery process will be started, if it is the initial call to this method on this scheduler instance.

Throws:
SchedulerException - if shutdown() has been called, or there is an error within the Scheduler.
See Also:
startDelayed(int), standby(), shutdown()

startDelayed

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.

Throws:
SchedulerException - if shutdown() has been called, or there is an error within the Scheduler.
See Also:
start(), standby(), shutdown()

isStarted

boolean isStarted()
                  throws SchedulerException
Whether the scheduler has been started.

Note: This only reflects whether start() has ever been called on this Scheduler, so it will return true even if the Scheduler is currently in standby mode or has been since shutdown.

Throws:
SchedulerException
See Also:
start(), isShutdown(), isInStandbyMode()

standby

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.

Throws:
SchedulerException
See Also:
start(), pauseAll()

isInStandbyMode

boolean isInStandbyMode()
                        throws SchedulerException
Reports whether the Scheduler is in stand-by mode.

Throws:
SchedulerException
See Also:
standby(), start()

shutdown

void shutdown()
              throws SchedulerException
Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler. Equivalent to shutdown(false).

The scheduler cannot be re-started.

Throws:
SchedulerException
See Also:
shutdown(boolean)

shutdown

void shutdown(boolean waitForJobsToComplete)
              throws SchedulerException
Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.

The scheduler cannot be re-started.

Parameters:
waitForJobsToComplete - if true the scheduler will not allow this method to return until all currently executing jobs have completed.
Throws:
SchedulerException
See Also:
shutdown()

isShutdown

boolean isShutdown()
                   throws SchedulerException
Reports whether the Scheduler has been shutdown.

Throws:
SchedulerException

getMetaData

SchedulerMetaData getMetaData()
                              throws SchedulerException
Get a SchedulerMetaData object describing 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.

Throws:
SchedulerException

getCurrentlyExecutingJobs

List<JobExecutionContext> 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.

Throws:
SchedulerException
See Also:
JobExecutionContext

setJobFactory

void setJobFactory(org.quartz.spi.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 opportunity for dependency injection.

Throws:
SchedulerException
See Also:
JobFactory

getListenerManager

ListenerManager getListenerManager()
                                   throws SchedulerException
Get a reference to the scheduler's ListenerManager, through which listeners may be registered.

Returns:
the scheduler's ListenerManager
Throws:
SchedulerException - if the scheduler is not local
See Also:
ListenerManager, JobListener, TriggerListener, SchedulerListener

scheduleJob

Date scheduleJob(JobDetail jobDetail,
                 Trigger trigger)
                 throws SchedulerException
Add the given JobDetail to the Scheduler, and associate the given Trigger with it.

If the given Trigger does not reference any Job, then it will be set to reference the Job passed with it into this method.

Throws:
SchedulerException - if the Job or Trigger cannot be added to the Scheduler, or there is an internal Scheduler error.

scheduleJob

Date scheduleJob(Trigger trigger)
                 throws SchedulerException
Schedule the given Trigger with the Job identified by the Trigger's settings.

Throws:
SchedulerException - if the indicated Job does not exist, or the Trigger cannot be added to the Scheduler, or there is an internal Scheduler error.

scheduleJobs

void scheduleJobs(Map<JobDetail,List<Trigger>> triggersAndJobs,
                  boolean replace)
                  throws SchedulerException
Schedule all of the given jobs with the related set of triggers.

If any of the given jobs or triggers already exist (or more specifically, if the keys are not unique) and the replace parameter is not set to true then an exception will be thrown.

Throws:
ObjectAlreadyExistsException - if the job/trigger keys are not unique and the replace flag is not set to true.
SchedulerException

unscheduleJob

boolean unscheduleJob(TriggerKey triggerKey)
                      throws SchedulerException
Remove the indicated Trigger from the scheduler.

If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.

Throws:
SchedulerException

unscheduleJobs

boolean unscheduleJobs(List<TriggerKey> triggerKeys)
                       throws SchedulerException
Remove all of the indicated Triggers from the scheduler.

If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.

Note that while this bulk operation is likely more efficient than invoking unscheduleJob(TriggerKey triggerKey) several times, it may have the adverse affect of holding data locks for a single long duration of time (rather than lots of small durations of time).

Throws:
SchedulerException

rescheduleJob

Date rescheduleJob(TriggerKey triggerKey,
                   Trigger newTrigger)
                   throws SchedulerException
Remove (delete) the Trigger with the given key, 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.

Parameters:
triggerKey - identity of the trigger to replace
newTrigger - The new Trigger to be stored.
Returns:
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.
Throws:
SchedulerException

addJob

void 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.

Throws:
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.

deleteJob

boolean deleteJob(JobKey jobKey)
                  throws SchedulerException
Delete the identified Job from the Scheduler - and any associated Triggers.

Returns:
true if the Job was found and deleted.
Throws:
SchedulerException - if there is an internal Scheduler error.

deleteJobs

boolean deleteJobs(List<JobKey> jobKeys)
                   throws SchedulerException
Delete the identified Jobs from the Scheduler - and any associated Triggers.

Note that while this bulk operation is likely more efficient than invoking deleteJob(JobKey jobKey) several times, it may have the adverse affect of holding data locks for a single long duration of time (rather than lots of small durations of time).

Returns:
true if all of the Jobs were found and deleted, false if one or more were not deleted.
Throws:
SchedulerException - if there is an internal Scheduler error.

triggerJob

void triggerJob(JobKey jobKey)
                throws SchedulerException
Trigger the identified JobDetail (execute it now).

Throws:
SchedulerException

triggerJob

void triggerJob(JobKey jobKey,
                JobDataMap data)
                throws SchedulerException
Trigger the identified JobDetail (execute it now).

Parameters:
data - the (possibly null) JobDataMap to be associated with the trigger that fires the job immediately.
Throws:
SchedulerException

pauseJob

void pauseJob(JobKey jobKey)
              throws SchedulerException
Pause the JobDetail with the given key - by pausing all of its current Triggers.

Throws:
SchedulerException
See Also:
resumeJob(JobKey)

pauseJobs

void pauseJobs(GroupMatcher<JobKey> matcher)
               throws SchedulerException
Pause all of the JobDetails in the matching groups - by pausing all of their Triggers.

The Scheduler will "remember" the groups paused, and impose the pause on any new jobs that are added to any of those groups until it is resumed.

Parameters:
matcher - The matcher to evaluate against know groups
Throws:
SchedulerException - On error
See Also:
resumeJobs(org.quartz.impl.matchers.GroupMatcher)

pauseTrigger

void pauseTrigger(TriggerKey triggerKey)
                  throws SchedulerException
Pause the Trigger with the given key.

Throws:
SchedulerException
See Also:
resumeTrigger(TriggerKey)

pauseTriggers

void pauseTriggers(GroupMatcher<TriggerKey> matcher)
                   throws SchedulerException
Pause all of the Triggers in the groups matching.

The Scheduler will "remember" all the groups paused, and impose the pause on any new triggers that are added to any of those groups until it is resumed.

Parameters:
matcher - The matcher to evaluate against know groups
Throws:
SchedulerException
See Also:
resumeTriggers(org.quartz.impl.matchers.GroupMatcher)

resumeJob

void resumeJob(JobKey jobKey)
               throws SchedulerException
Resume (un-pause) the JobDetail with the given key.

If any of the Job'sTrigger s missed one or more fire-times, then the Trigger's misfire instruction will be applied.

Throws:
SchedulerException
See Also:
pauseJob(JobKey)

resumeJobs

void resumeJobs(GroupMatcher<JobKey> matcher)
                throws SchedulerException
Resume (un-pause) all of the JobDetails in matching groups.

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.

Parameters:
matcher - The matcher to evaluate against known paused groups
Throws:
SchedulerException - On error
See Also:
pauseJobs(GroupMatcher)

resumeTrigger

void resumeTrigger(TriggerKey triggerKey)
                   throws SchedulerException
Resume (un-pause) the Trigger with the given key.

If the Trigger missed one or more fire-times, then the Trigger's misfire instruction will be applied.

Throws:
SchedulerException
See Also:
pauseTrigger(TriggerKey)

resumeTriggers

void resumeTriggers(GroupMatcher<TriggerKey> matcher)
                    throws SchedulerException
Resume (un-pause) all of the Triggers in matching groups.

If any Trigger missed one or more fire-times, then the Trigger's misfire instruction will be applied.

Parameters:
matcher - The matcher to evaluate against know paused groups
Throws:
SchedulerException - On error
See Also:
pauseTriggers(org.quartz.impl.matchers.GroupMatcher)

pauseAll

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.

Throws:
SchedulerException
See Also:
resumeAll(), pauseTriggers(org.quartz.impl.matchers.GroupMatcher), standby()

resumeAll

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.

Throws:
SchedulerException
See Also:
pauseAll()

getJobGroupNames

List<String> getJobGroupNames()
                              throws SchedulerException
Get the names of all known JobDetail groups.

Throws:
SchedulerException

getJobKeys

Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
                       throws SchedulerException
Get the keys of all the JobDetails in the matching groups.

Parameters:
matcher - Matcher to evaluate against known groups
Returns:
Set of all keys matching
Throws:
SchedulerException - On error

getTriggersOfJob

List<? extends Trigger> getTriggersOfJob(JobKey jobKey)
                                         throws SchedulerException
Get all Trigger s that are associated with the identified JobDetail.

The returned Trigger objects will be snap-shots of the actual stored triggers. If you wish to modify a trigger, you must re-store the trigger afterward (e.g. see rescheduleJob(TriggerKey, Trigger)).

Throws:
SchedulerException

getTriggerGroupNames

List<String> getTriggerGroupNames()
                                  throws SchedulerException
Get the names of all known Trigger groups.

Throws:
SchedulerException

getTriggerKeys

Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
                               throws SchedulerException
Get the names of all the Triggers in the given group.

Parameters:
matcher - Matcher to evaluate against known groups
Returns:
List of all keys matching
Throws:
SchedulerException - On error

getPausedTriggerGroups

Set<String> getPausedTriggerGroups()
                                   throws SchedulerException
Get the names of all Trigger groups that are paused.

Throws:
SchedulerException

getJobDetail

JobDetail getJobDetail(JobKey jobKey)
                       throws SchedulerException
Get the JobDetail for the Job instance with the given key.

The returned JobDetail object will be a snap-shot of the actual stored JobDetail. If you wish to modify the JobDetail, you must re-store the JobDetail afterward (e.g. see addJob(JobDetail, boolean)).

Throws:
SchedulerException

getTrigger

Trigger getTrigger(TriggerKey triggerKey)
                   throws SchedulerException
Get the Trigger instance with the given key.

The returned Trigger object will be a snap-shot of the actual stored trigger. If you wish to modify the trigger, you must re-store the trigger afterward (e.g. see rescheduleJob(TriggerKey, Trigger)).

Throws:
SchedulerException

getTriggerState

Trigger.TriggerState getTriggerState(TriggerKey triggerKey)
                                     throws SchedulerException
Get the current state of the identified Trigger.

Throws:
SchedulerException
See Also:
Trigger.TriggerState

addCalendar

void addCalendar(String calName,
                 Calendar calendar,
                 boolean replace,
                 boolean updateTriggers)
                 throws SchedulerException
Add (register) the given Calendar to the Scheduler.

Parameters:
updateTriggers - whether or not to update existing triggers that referenced the already existing calendar so that they are 'correct' based on the new trigger.
Throws:
SchedulerException - if there is an internal Scheduler error, or a Calendar with the same name already exists, and replace is false.

deleteCalendar

boolean deleteCalendar(String calName)
                       throws SchedulerException
Delete the identified Calendar from the Scheduler.

Returns:
true if the Calendar was found and deleted.
Throws:
SchedulerException - if there is an internal Scheduler error.

getCalendar

Calendar getCalendar(String calName)
                     throws SchedulerException
Get the Calendar instance with the given name.

Throws:
SchedulerException

getCalendarNames

List<String> getCalendarNames()
                              throws SchedulerException
Get the names of all registered Calendars.

Throws:
SchedulerException

interrupt

boolean interrupt(JobKey jobKey)
                  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 getCurrentlyExecutingJobs() to obtain a handle to the job instance, and then invoke 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.

Returns:
true is at least one instance of the identified job was found and interrupted.
Throws:
UnableToInterruptJobException - if the job does not implement InterruptableJob, or there is an exception while interrupting the job.
See Also:
InterruptableJob.interrupt(), getCurrentlyExecutingJobs()

checkExists

boolean checkExists(JobKey jobKey)
                    throws SchedulerException
Determine whether a Job with the given identifier already exists within the scheduler.

Parameters:
jobKey - the identifier to check for
Returns:
true if a Job exists with the given identifier
Throws:
SchedulerException

checkExists

boolean checkExists(TriggerKey triggerKey)
                    throws SchedulerException
Determine whether a Trigger with the given identifier already exists within the scheduler.

Parameters:
triggerKey - the identifier to check for
Returns:
true if a Trigger exists with the given identifier
Throws:
SchedulerException

clear

void clear()
           throws SchedulerException
Clears (deletes!) all scheduling data - all Jobs, Triggers Calendars.

Throws:
SchedulerException


Copyright 2001-2011, Terracotta, Inc.