QuartzScheduler (Quartz Parent POM 2.0.1 API)

Quartz Java



org.quartz.core Class QuartzScheduler

java.lang.Object
  extended by org.quartz.core.QuartzScheduler
All Implemented Interfaces:
Remote, RemotableQuartzScheduler

public class QuartzScheduler
extends Object
implements RemotableQuartzScheduler

This is the heart of Quartz, an indirect implementation of the Scheduler interface, containing methods to schedule Jobs, register JobListener instances, etc.

Author:
James House
See Also:
Scheduler, QuartzSchedulerThread, JobStore, ThreadPool

Constructor Summary
QuartzScheduler(QuartzSchedulerResources resources, long idleWaitTime, long dbRetryInterval)
           Create a QuartzScheduler with the given configuration properties.
 
Method Summary
 void addCalendar(String calName, Calendar calendar, boolean replace, boolean updateTriggers)
           Add (register) the given Calendar to the Scheduler.
 void addInternalJobListener(JobListener jobListener)
           Add the given JobListener to the Scheduler's internal list.
 void addInternalSchedulerListener(SchedulerListener schedulerListener)
           Register the given SchedulerListener with the Scheduler's list of internal listeners.
 void addInternalTriggerListener(TriggerListener triggerListener)
           Add the given TriggerListener to the Scheduler's internal list.
 void addJob(JobDetail jobDetail, boolean replace)
           Add the given Job to the Scheduler - with no associated Trigger.
 void addNoGCObject(Object obj)
           
 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)
           
 Calendar getCalendar(String calName)
           Get the Calendar instance with the given name.
 List<String> getCalendarNames()
           Get the names of all registered Calendars.
 List<JobExecutionContext> getCurrentlyExecutingJobs()
           Return a list of JobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance.
 JobListener getInternalJobListener(String name)
           Get the internal JobListener that has the given name.
 List<JobListener> getInternalJobListeners()
           Get a List containing all of the JobListeners in the Scheduler's internal list.
 List<SchedulerListener> getInternalSchedulerListeners()
           Get a List containing all of the internal SchedulerListeners registered with the Scheduler.
 TriggerListener getInternalTriggerListener(String name)
           Get the internal TriggerListener that has the given name.
 List<TriggerListener> getInternalTriggerListeners()
           Get a list containing all of the TriggerListeners in the Scheduler's internal list.
 JobDetail getJobDetail(JobKey jobKey)
           Get the JobDetail for the Job instance with the given name and group.
 org.quartz.spi.JobFactory getJobFactory()
           
 List<String> getJobGroupNames()
           Get the names of all known Job groups.
 Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
           Get the names of all the Jobs in the matching groups.
 Class getJobStoreClass()
           
 ListenerManager getListenerManager()
           
 org.slf4j.Logger getLog()
           
 Set getPausedTriggerGroups()
           
 SchedulerContext getSchedulerContext()
           Returns the SchedulerContext of the Scheduler.
 String getSchedulerInstanceId()
           Returns the instance Id of the QuartzScheduler.
 String getSchedulerName()
           Returns the name of the QuartzScheduler.
 org.quartz.spi.SchedulerSignaler getSchedulerSignaler()
           
 ThreadGroup getSchedulerThreadGroup()
           Returns the name of the thread group for Quartz's main threads.
 Class getThreadPoolClass()
           
 int getThreadPoolSize()
           
 Trigger getTrigger(TriggerKey triggerKey)
           Get the Trigger instance with the given name and group.
 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 matching groups.
 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.
 String getVersion()
           
static String getVersionIteration()
           
static String getVersionMajor()
           
static String getVersionMinor()
           
 void initialize()
           
 boolean interrupt(JobKey jobKey)
          Interrupt all instances of the identified InterruptableJob executing in this Scheduler instance.
 boolean isClustered()
           
 boolean isInStandbyMode()
           Reports whether the Scheduler is paused.
 boolean isShutdown()
           Reports whether the Scheduler has been shutdown.
 boolean isShuttingDown()
           
 boolean isSignalOnSchedulingChange()
           
 boolean isStarted()
           
 void notifyJobListenersToBeExecuted(JobExecutionContext jec)
           
 void notifyJobListenersWasExecuted(JobExecutionContext jec, JobExecutionException je)
           
 void notifyJobListenersWasVetoed(JobExecutionContext jec)
           
protected  void notifyJobStoreJobComplete(org.quartz.spi.OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)
           
protected  void notifyJobStoreJobVetoed(org.quartz.spi.OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)
           
 void notifySchedulerListenersError(String msg, SchedulerException se)
           
 void notifySchedulerListenersFinalized(Trigger trigger)
           
 void notifySchedulerListenersInStandbyMode()
           
 void notifySchedulerListenersJobAdded(JobDetail jobDetail)
           
 void notifySchedulerListenersJobDeleted(JobKey jobKey)
           
 void notifySchedulerListenersPausedJob(JobKey key)
           
 void notifySchedulerListenersPausedJobs(String group)
           
 void notifySchedulerListenersPausedTrigger(TriggerKey triggerKey)
           
 void notifySchedulerListenersPausedTriggers(String group)
           
 void notifySchedulerListenersResumedJob(JobKey key)
           
 void notifySchedulerListenersResumedJobs(String group)
           
 void notifySchedulerListenersResumedTrigger(TriggerKey key)
           
 void notifySchedulerListenersResumedTriggers(String group)
           
 void notifySchedulerListenersSchduled(Trigger trigger)
           
 void notifySchedulerListenersShutdown()
           
 void notifySchedulerListenersShuttingdown()
           
 void notifySchedulerListenersStarted()
           
 void notifySchedulerListenersUnscheduled(TriggerKey triggerKey)
           
protected  void notifySchedulerThread(long candidateNewNextFireTime)
           
 void notifyTriggerListenersComplete(JobExecutionContext jec, Trigger.CompletedExecutionInstruction instCode)
           
 boolean notifyTriggerListenersFired(JobExecutionContext jec)
           
 void notifyTriggerListenersMisfired(Trigger trigger)
           
 int numJobsExecuted()
           
 void pauseAll()
           Pause all triggers - equivalent of calling pauseTriggers(GroupMatcher) with a matcher matching all known groups.
 void pauseJob(JobKey jobKey)
           Pause the JobDetail with the given name - by pausing all of its current Triggers.
 void pauseJobs(GroupMatcher<JobKey> groupMatcher)
           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 name.
 void pauseTriggers(GroupMatcher<TriggerKey> matcher)
           Pause all of the Triggers in the matching groups.
 boolean removeInternalJobListener(String name)
           Remove the identified JobListener from the Scheduler's list of internal listeners.
 boolean removeInternalSchedulerListener(SchedulerListener schedulerListener)
           Remove the given SchedulerListener from the Scheduler's list of internal listeners.
 boolean removeinternalTriggerListener(String name)
           Remove the identified TriggerListener from the Scheduler's list of internal listeners.
 boolean removeNoGCObject(Object obj)
           
 Date rescheduleJob(TriggerKey triggerKey, Trigger newTrigger)
           Remove (delete) the Trigger with the given name, and store the new given one - which must be associated with the same job.
 void resumeAll()
           Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) on every group.
 void resumeJob(JobKey jobKey)
           Resume (un-pause) the JobDetail with the given name.
 void resumeJobs(GroupMatcher<JobKey> matcher)
           Resume (un-pause) all of the JobDetails in the matching groups.
 void resumeTrigger(TriggerKey triggerKey)
           Resume (un-pause) the Trigger with the given name.
 void resumeTriggers(GroupMatcher<TriggerKey> matcher)
           Resume (un-pause) all of the Triggers in the matching groups.
 Date runningSince()
           
 Date scheduleJob(JobDetail jobDetail, Trigger trigger)
           Add the Job identified by 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)
           
 void setJobFactory(org.quartz.spi.JobFactory factory)
           
 void setSignalOnSchedulingChange(boolean signalOnSchedulingChange)
           
 void shutdown()
           Halts the QuartzScheduler's firing of Triggers, and cleans up all resources associated with the QuartzScheduler.
 void shutdown(boolean waitForJobsToComplete)
           Halts the QuartzScheduler's firing of Triggers, and cleans up all resources associated with the QuartzScheduler.
 void standby()
           Temporarily halts the QuartzScheduler's firing of Triggers.
 void start()
           Starts the QuartzScheduler's threads that fire Triggers.
 void startDelayed(int seconds)
           
 boolean supportsPersistence()
           
 void triggerJob(JobKey jobKey, JobDataMap data)
           Trigger the identified Job (execute it now) - with a non-volatile trigger.
 void triggerJob(org.quartz.spi.OperableTrigger trig)
           Store and schedule the identified OperableTrigger
 boolean unscheduleJob(TriggerKey triggerKey)
           Remove the indicated Trigger from the scheduler.
 boolean unscheduleJobs(List<TriggerKey> triggerKeys)
           
 void validateState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuartzScheduler

public QuartzScheduler(QuartzSchedulerResources resources,
                       long idleWaitTime,
                       long dbRetryInterval)
                throws SchedulerException

Create a QuartzScheduler with the given configuration properties.

Throws:
SchedulerException
See Also:
QuartzSchedulerResources

Method Detail

initialize

public void initialize()
                throws SchedulerException
Throws:
SchedulerException

getVersion

public String getVersion()
Specified by:
getVersion in interface RemotableQuartzScheduler

getVersionMajor

public static String getVersionMajor()

getVersionMinor

public static String getVersionMinor()

getVersionIteration

public static String getVersionIteration()

getSchedulerSignaler

public org.quartz.spi.SchedulerSignaler getSchedulerSignaler()

getLog

public org.slf4j.Logger getLog()

getSchedulerName

public String getSchedulerName()

Returns the name of the QuartzScheduler.

Specified by:
getSchedulerName in interface RemotableQuartzScheduler

getSchedulerInstanceId

public String getSchedulerInstanceId()

Returns the instance Id of the QuartzScheduler.

Specified by:
getSchedulerInstanceId in interface RemotableQuartzScheduler

getSchedulerThreadGroup

public ThreadGroup getSchedulerThreadGroup()

Returns the name of the thread group for Quartz's main threads.


addNoGCObject

public void addNoGCObject(Object obj)

removeNoGCObject

public boolean removeNoGCObject(Object obj)

getSchedulerContext

public SchedulerContext getSchedulerContext()
                                     throws SchedulerException

Returns the SchedulerContext of the Scheduler.

Specified by:
getSchedulerContext in interface RemotableQuartzScheduler
Throws:
SchedulerException

isSignalOnSchedulingChange

public boolean isSignalOnSchedulingChange()

setSignalOnSchedulingChange

public void setSignalOnSchedulingChange(boolean signalOnSchedulingChange)

start

public void start()
           throws SchedulerException

Starts the QuartzScheduler's threads that fire Triggers.

All Triggers that have misfired will be passed to the appropriate TriggerListener(s).

Specified by:
start in interface RemotableQuartzScheduler
Throws:
SchedulerException

startDelayed

public void startDelayed(int seconds)
                  throws SchedulerException
Specified by:
startDelayed in interface RemotableQuartzScheduler
Throws:
SchedulerException

standby

public void standby()

Temporarily halts the QuartzScheduler's firing of Triggers.

The scheduler is not destroyed, and can be re-started at any time.

Specified by:
standby in interface RemotableQuartzScheduler

isInStandbyMode

public boolean isInStandbyMode()

Reports whether the Scheduler is paused.

Specified by:
isInStandbyMode in interface RemotableQuartzScheduler

runningSince

public Date runningSince()
Specified by:
runningSince in interface RemotableQuartzScheduler

numJobsExecuted

public int numJobsExecuted()
Specified by:
numJobsExecuted in interface RemotableQuartzScheduler

getJobStoreClass

public Class getJobStoreClass()
Specified by:
getJobStoreClass in interface RemotableQuartzScheduler

supportsPersistence

public boolean supportsPersistence()
Specified by:
supportsPersistence in interface RemotableQuartzScheduler

isClustered

public boolean isClustered()
Specified by:
isClustered in interface RemotableQuartzScheduler

getThreadPoolClass

public Class getThreadPoolClass()
Specified by:
getThreadPoolClass in interface RemotableQuartzScheduler

getThreadPoolSize

public int getThreadPoolSize()
Specified by:
getThreadPoolSize in interface RemotableQuartzScheduler

shutdown

public void shutdown()

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

The scheduler cannot be re-started.

Specified by:
shutdown in interface RemotableQuartzScheduler

shutdown

public void shutdown(boolean waitForJobsToComplete)

Halts the QuartzScheduler's firing of Triggers, and cleans up all resources associated with the QuartzScheduler.

The scheduler cannot be re-started.

Specified by:
shutdown in interface RemotableQuartzScheduler
Parameters:
waitForJobsToComplete - if true the scheduler will not allow this method to return until all currently executing jobs have completed.

isShutdown

public boolean isShutdown()

Reports whether the Scheduler has been shutdown.

Specified by:
isShutdown in interface RemotableQuartzScheduler

isShuttingDown

public boolean isShuttingDown()

isStarted

public boolean isStarted()

validateState

public void validateState()
                   throws SchedulerException
Throws:
SchedulerException

getCurrentlyExecutingJobs

public List<JobExecutionContext> getCurrentlyExecutingJobs()

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.

Specified by:
getCurrentlyExecutingJobs in interface RemotableQuartzScheduler

scheduleJob

public Date scheduleJob(JobDetail jobDetail,
                        Trigger trigger)
                 throws SchedulerException

Add the Job identified by 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.

Specified by:
scheduleJob in interface RemotableQuartzScheduler
Throws:
SchedulerException - if the Job or Trigger cannot be added to the Scheduler, or there is an internal Scheduler error.

scheduleJob

public Date scheduleJob(Trigger trigger)
                 throws SchedulerException

Schedule the given Trigger with the Job identified by the Trigger's settings.

Specified by:
scheduleJob in interface RemotableQuartzScheduler
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.

addJob

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

Specified by:
addJob in interface RemotableQuartzScheduler
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

public boolean deleteJob(JobKey jobKey)
                  throws SchedulerException

Delete the identified Job from the Scheduler - and any associated Triggers.

Specified by:
deleteJob in interface RemotableQuartzScheduler
Returns:
true if the Job was found and deleted.
Throws:
SchedulerException - if there is an internal Scheduler error.

deleteJobs

public boolean deleteJobs(List<JobKey> jobKeys)
                   throws SchedulerException
Specified by:
deleteJobs in interface RemotableQuartzScheduler
Throws:
SchedulerException

scheduleJobs

public void scheduleJobs(Map<JobDetail,List<Trigger>> triggersAndJobs,
                         boolean replace)
                  throws SchedulerException
Specified by:
scheduleJobs in interface RemotableQuartzScheduler
Throws:
SchedulerException

unscheduleJobs

public boolean unscheduleJobs(List<TriggerKey> triggerKeys)
                       throws SchedulerException
Specified by:
unscheduleJobs in interface RemotableQuartzScheduler
Throws:
SchedulerException

unscheduleJob

public boolean unscheduleJob(TriggerKey triggerKey)
                      throws SchedulerException

Remove the indicated Trigger from the scheduler.

Specified by:
unscheduleJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

rescheduleJob

public Date rescheduleJob(TriggerKey triggerKey,
                          Trigger newTrigger)
                   throws SchedulerException

Remove (delete) the Trigger with the given name, and store the new given one - which must be associated with the same job.

Specified by:
rescheduleJob in interface RemotableQuartzScheduler
Parameters:
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

triggerJob

public void triggerJob(JobKey jobKey,
                       JobDataMap data)
                throws SchedulerException

Trigger the identified Job (execute it now) - with a non-volatile trigger.

Specified by:
triggerJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

triggerJob

public void triggerJob(org.quartz.spi.OperableTrigger trig)
                throws SchedulerException

Store and schedule the identified OperableTrigger

Specified by:
triggerJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseTrigger

public void pauseTrigger(TriggerKey triggerKey)
                  throws SchedulerException

Pause the Trigger with the given name.

Specified by:
pauseTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseTriggers

public void pauseTriggers(GroupMatcher<TriggerKey> matcher)
                   throws SchedulerException

Pause all of the Triggers in the matching groups.

Specified by:
pauseTriggers in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseJob

public void pauseJob(JobKey jobKey)
              throws SchedulerException

Pause the JobDetail with the given name - by pausing all of its current Triggers.

Specified by:
pauseJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseJobs

public void pauseJobs(GroupMatcher<JobKey> groupMatcher)
               throws SchedulerException

Pause all of the JobDetails in the matching groups - by pausing all of their Triggers.

Specified by:
pauseJobs in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeTrigger

public void resumeTrigger(TriggerKey triggerKey)
                   throws SchedulerException

Resume (un-pause) the Trigger with the given name.

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

Specified by:
resumeTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeTriggers

public void resumeTriggers(GroupMatcher<TriggerKey> matcher)
                    throws SchedulerException

Resume (un-pause) all of the Triggers in the matching groups.

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

Specified by:
resumeTriggers in interface RemotableQuartzScheduler
Throws:
SchedulerException

getPausedTriggerGroups

public Set getPausedTriggerGroups()
                           throws SchedulerException
Specified by:
getPausedTriggerGroups in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeJob

public void resumeJob(JobKey jobKey)
               throws SchedulerException

Resume (un-pause) the JobDetail with the given name.

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

Specified by:
resumeJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeJobs

public void resumeJobs(GroupMatcher<JobKey> matcher)
                throws SchedulerException

Resume (un-pause) all of the JobDetails in the 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.

Specified by:
resumeJobs in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseAll

public void pauseAll()
              throws SchedulerException

Pause all triggers - equivalent of calling pauseTriggers(GroupMatcher) with a matcher matching all known groups.

When resumeAll() is called (to un-pause), trigger misfire instructions WILL be applied.

Specified by:
pauseAll in interface RemotableQuartzScheduler
Throws:
SchedulerException
See Also:
resumeAll(), pauseTriggers(org.quartz.impl.matchers.GroupMatcher), standby()

resumeAll

public void resumeAll()
               throws SchedulerException

Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) on every group.

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

Specified by:
resumeAll in interface RemotableQuartzScheduler
Throws:
SchedulerException
See Also:
pauseAll()

getJobGroupNames

public List<String> getJobGroupNames()
                              throws SchedulerException

Get the names of all known Job groups.

Specified by:
getJobGroupNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getJobKeys

public Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
                       throws SchedulerException

Get the names of all the Jobs in the matching groups.

Specified by:
getJobKeys in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggersOfJob

public List<? extends Trigger> getTriggersOfJob(JobKey jobKey)
                                         throws SchedulerException

Get all Trigger s that are associated with the identified JobDetail.

Specified by:
getTriggersOfJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerGroupNames

public List<String> getTriggerGroupNames()
                                  throws SchedulerException

Get the names of all known Trigger groups.

Specified by:
getTriggerGroupNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerKeys

public Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
                               throws SchedulerException

Get the names of all the Triggers in the matching groups.

Specified by:
getTriggerKeys in interface RemotableQuartzScheduler
Throws:
SchedulerException

getJobDetail

public JobDetail getJobDetail(JobKey jobKey)
                       throws SchedulerException

Get the JobDetail for the Job instance with the given name and group.

Specified by:
getJobDetail in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTrigger

public Trigger getTrigger(TriggerKey triggerKey)
                   throws SchedulerException

Get the Trigger instance with the given name and group.

Specified by:
getTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

checkExists

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

Specified by:
checkExists in interface RemotableQuartzScheduler
Parameters:
jobKey - the identifier to check for
Returns:
true if a Job exists with the given identifier
Throws:
SchedulerException

checkExists

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

Specified by:
checkExists in interface RemotableQuartzScheduler
Parameters:
triggerKey - the identifier to check for
Returns:
true if a Trigger exists with the given identifier
Throws:
SchedulerException

clear

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

Specified by:
clear in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerState

public Trigger.TriggerState getTriggerState(TriggerKey triggerKey)
                                     throws SchedulerException

Get the current state of the identified Trigger.

Specified by:
getTriggerState in interface RemotableQuartzScheduler
Throws:
SchedulerException
See Also:
Trigger.TriggerState

addCalendar

public void addCalendar(String calName,
                        Calendar calendar,
                        boolean replace,
                        boolean updateTriggers)
                 throws SchedulerException

Add (register) the given Calendar to the Scheduler.

Specified by:
addCalendar in interface RemotableQuartzScheduler
Throws:
SchedulerException - if there is an internal Scheduler error, or a Calendar with the same name already exists, and replace is false.

deleteCalendar

public boolean deleteCalendar(String calName)
                       throws SchedulerException

Delete the identified Calendar from the Scheduler.

Specified by:
deleteCalendar in interface RemotableQuartzScheduler
Returns:
true if the Calendar was found and deleted.
Throws:
SchedulerException - if there is an internal Scheduler error.

getCalendar

public Calendar getCalendar(String calName)
                     throws SchedulerException

Get the Calendar instance with the given name.

Specified by:
getCalendar in interface RemotableQuartzScheduler
Throws:
SchedulerException

getCalendarNames

public List<String> getCalendarNames()
                              throws SchedulerException

Get the names of all registered Calendars.

Specified by:
getCalendarNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getListenerManager

public ListenerManager getListenerManager()

addInternalJobListener

public void addInternalJobListener(JobListener jobListener)

Add the given JobListener to the Scheduler's internal list.


removeInternalJobListener

public boolean removeInternalJobListener(String name)

Remove the identified JobListener from the Scheduler's list of internal listeners.

Returns:
true if the identified listener was found in the list, and removed.

getInternalJobListeners

public List<JobListener> getInternalJobListeners()

Get a List containing all of the JobListeners in the Scheduler's internal list.


getInternalJobListener

public JobListener getInternalJobListener(String name)

Get the internal JobListener that has the given name.


addInternalTriggerListener

public void addInternalTriggerListener(TriggerListener triggerListener)

Add the given TriggerListener to the Scheduler's internal list.


removeinternalTriggerListener

public boolean removeinternalTriggerListener(String name)

Remove the identified TriggerListener from the Scheduler's list of internal listeners.

Returns:
true if the identified listener was found in the list, and removed.

getInternalTriggerListeners

public List<TriggerListener> getInternalTriggerListeners()

Get a list containing all of the TriggerListeners in the Scheduler's internal list.


getInternalTriggerListener

public TriggerListener getInternalTriggerListener(String name)

Get the internal TriggerListener that has the given name.


addInternalSchedulerListener

public void addInternalSchedulerListener(SchedulerListener schedulerListener)

Register the given SchedulerListener with the Scheduler's list of internal listeners.


removeInternalSchedulerListener

public boolean removeInternalSchedulerListener(SchedulerListener schedulerListener)

Remove the given SchedulerListener from the Scheduler's list of internal listeners.

Returns:
true if the identified listener was found in the list, and removed.

getInternalSchedulerListeners

public List<SchedulerListener> getInternalSchedulerListeners()

Get a List containing all of the internal SchedulerListeners registered with the Scheduler.


notifyJobStoreJobComplete

protected void notifyJobStoreJobComplete(org.quartz.spi.OperableTrigger trigger,
                                         JobDetail detail,
                                         Trigger.CompletedExecutionInstruction instCode)
                                  throws JobPersistenceException
Throws:
JobPersistenceException

notifyJobStoreJobVetoed

protected void notifyJobStoreJobVetoed(org.quartz.spi.OperableTrigger trigger,
                                       JobDetail detail,
                                       Trigger.CompletedExecutionInstruction instCode)
                                throws JobPersistenceException
Throws:
JobPersistenceException

notifySchedulerThread

protected void notifySchedulerThread(long candidateNewNextFireTime)

notifyTriggerListenersFired

public boolean notifyTriggerListenersFired(JobExecutionContext jec)
                                    throws SchedulerException
Throws:
SchedulerException

notifyTriggerListenersMisfired

public void notifyTriggerListenersMisfired(Trigger trigger)
                                    throws SchedulerException
Throws:
SchedulerException

notifyTriggerListenersComplete

public void notifyTriggerListenersComplete(JobExecutionContext jec,
                                           Trigger.CompletedExecutionInstruction instCode)
                                    throws SchedulerException
Throws:
SchedulerException

notifyJobListenersToBeExecuted

public void notifyJobListenersToBeExecuted(JobExecutionContext jec)
                                    throws SchedulerException
Throws:
SchedulerException

notifyJobListenersWasVetoed

public void notifyJobListenersWasVetoed(JobExecutionContext jec)
                                 throws SchedulerException
Throws:
SchedulerException

notifyJobListenersWasExecuted

public void notifyJobListenersWasExecuted(JobExecutionContext jec,
                                          JobExecutionException je)
                                   throws SchedulerException
Throws:
SchedulerException

notifySchedulerListenersError

public void notifySchedulerListenersError(String msg,
                                          SchedulerException se)

notifySchedulerListenersSchduled

public void notifySchedulerListenersSchduled(Trigger trigger)

notifySchedulerListenersUnscheduled

public void notifySchedulerListenersUnscheduled(TriggerKey triggerKey)

notifySchedulerListenersFinalized

public void notifySchedulerListenersFinalized(Trigger trigger)

notifySchedulerListenersPausedTrigger

public void notifySchedulerListenersPausedTrigger(TriggerKey triggerKey)

notifySchedulerListenersPausedTriggers

public void notifySchedulerListenersPausedTriggers(String group)

notifySchedulerListenersResumedTrigger

public void notifySchedulerListenersResumedTrigger(TriggerKey key)

notifySchedulerListenersResumedTriggers

public void notifySchedulerListenersResumedTriggers(String group)

notifySchedulerListenersPausedJob

public void notifySchedulerListenersPausedJob(JobKey key)

notifySchedulerListenersPausedJobs

public void notifySchedulerListenersPausedJobs(String group)

notifySchedulerListenersResumedJob

public void notifySchedulerListenersResumedJob(JobKey key)

notifySchedulerListenersResumedJobs

public void notifySchedulerListenersResumedJobs(String group)

notifySchedulerListenersInStandbyMode

public void notifySchedulerListenersInStandbyMode()

notifySchedulerListenersStarted

public void notifySchedulerListenersStarted()

notifySchedulerListenersShutdown

public void notifySchedulerListenersShutdown()

notifySchedulerListenersShuttingdown

public void notifySchedulerListenersShuttingdown()

notifySchedulerListenersJobAdded

public void notifySchedulerListenersJobAdded(JobDetail jobDetail)

notifySchedulerListenersJobDeleted

public void notifySchedulerListenersJobDeleted(JobKey jobKey)

setJobFactory

public void setJobFactory(org.quartz.spi.JobFactory factory)
                   throws SchedulerException
Throws:
SchedulerException

getJobFactory

public org.quartz.spi.JobFactory getJobFactory()

interrupt

public boolean interrupt(JobKey jobKey)
                  throws UnableToInterruptJobException
Interrupt all instances of the identified InterruptableJob executing in this Scheduler instance.

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.

Specified by:
interrupt in interface RemotableQuartzScheduler
Throws:
UnableToInterruptJobException
See Also:
RemotableQuartzScheduler.interrupt(JobKey)


Copyright 2001-2011, Terracotta, Inc.