org.quartz.core
Class QuartzScheduler

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

public class QuartzScheduler
extends java.lang.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.

// TODO: more docs...

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

Constructor Summary
QuartzScheduler(QuartzSchedulerResources resources, SchedulingContext ctxt, long idleWaitTime, long dbRetryInterval)
           Create a QuartzScheduler with the given configuration properties.
 
Method Summary
 void addCalendar(SchedulingContext ctxt, 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 JobListener to the Scheduler'sglobal list.
 void addGlobalTriggerListener(TriggerListener triggerListener)
           Add the given TriggerListener to the Scheduler'sglobal list.
 void addJob(SchedulingContext ctxt, JobDetail jobDetail, boolean replace)
           Add the given Job to the Scheduler - with no associated Trigger.
 void addJobListener(JobListener jobListener)
           Add the given JobListener to the Scheduler's list, of registered JobListeners.
 void addNoGCObject(java.lang.Object obj)
           
 void addSchedulerListener(SchedulerListener schedulerListener)
           Register the given SchedulerListener with the Scheduler.
 void addTriggerListener(TriggerListener triggerListener)
           Add the given TriggerListener to the Scheduler's list, of registered TriggerListeners.
 boolean deleteCalendar(SchedulingContext ctxt, java.lang.String calName)
           Delete the identified Calendar from the Scheduler.
 boolean deleteJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName)
           Delete the identified Job from the Scheduler - and any associated Triggers.
 Calendar getCalendar(SchedulingContext ctxt, java.lang.String calName)
           Get the Calendar instance with the given name.
 java.lang.String[] getCalendarNames(SchedulingContext ctxt)
           Get the names of all registered Calendars.
 java.util.List getCurrentlyExecutingJobs()
           Return a list of JobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance.
 long getDbRetryInterval()
           
 JobListener getGlobalJobListener(java.lang.String name)
           Get the globalJobListener that has the given name.
 java.util.List getGlobalJobListeners()
           Get a List containing all of the JobListener s in the Scheduler'sglobal list.
 TriggerListener getGlobalTriggerListener(java.lang.String name)
           Get the globalTriggerListener that has the given name.
 java.util.List getGlobalTriggerListeners()
           Get a list containing all of the TriggerListener s in the Scheduler'sglobal list.
 JobDetail getJobDetail(SchedulingContext ctxt, java.lang.String jobName, java.lang.String jobGroup)
           Get the JobDetail for the Job instance with the given name and group.
 JobFactory getJobFactory()
           
 java.lang.String[] getJobGroupNames(SchedulingContext ctxt)
           Get the names of all known Job groups.
 JobListener getJobListener(java.lang.String name)
           Get the non-globalJobListener that has the given name.
 java.util.Set getJobListenerNames()
           Get a Set containing the names of all the non-globalJobListener s registered with the Scheduler.
 java.lang.String[] getJobNames(SchedulingContext ctxt, java.lang.String groupName)
           Get the names of all the Jobs in the given group.
 java.lang.Class getJobStoreClass()
           
 org.slf4j.Logger getLog()
           
 java.util.Set getPausedTriggerGroups(SchedulingContext ctxt)
           
 SchedulerContext getSchedulerContext()
           Returns the SchedulerContext of the Scheduler.
 java.lang.String getSchedulerInstanceId()
           Returns the instance Id of the QuartzScheduler.
 java.util.List getSchedulerListeners()
           Get a List containing all of the SchedulerListener s registered with the Scheduler.
 java.lang.String getSchedulerName()
           Returns the name of the QuartzScheduler.
 SchedulerSignaler getSchedulerSignaler()
           
 java.lang.ThreadGroup getSchedulerThreadGroup()
           Returns the name of the QuartzScheduler.
 java.lang.Class getThreadPoolClass()
           
 int getThreadPoolSize()
           
 Trigger getTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String triggerGroup)
           Get the Trigger instance with the given name and group.
 java.lang.String[] getTriggerGroupNames(SchedulingContext ctxt)
           Get the names of all known Trigger groups.
 TriggerListener getTriggerListener(java.lang.String name)
           Get the non-globalTriggerListener that has the given name.
 java.util.Set getTriggerListenerNames()
           Get a Set containing the names of all the non-globalTriggerListener s registered with the Scheduler.
 java.lang.String[] getTriggerNames(SchedulingContext ctxt, java.lang.String groupName)
           Get the names of all the Triggers in the given group.
 Trigger[] getTriggersOfJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName)
           Get all Trigger s that are associated with the identified JobDetail.
 int getTriggerState(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String triggerGroup)
           Get the current state of the identified Trigger.
 java.lang.String getVersion()
           
static java.lang.String getVersionIteration()
           
static java.lang.String getVersionMajor()
           
static java.lang.String getVersionMinor()
           
 void initialize()
           
 boolean interrupt(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName)
          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 isSignalOnSchedulingChange()
           
 boolean isStarted()
           
 void notifyJobListenersToBeExecuted(JobExecutionContext jec)
           
 void notifyJobListenersWasExecuted(JobExecutionContext jec, JobExecutionException je)
           
 void notifyJobListenersWasVetoed(JobExecutionContext jec)
           
protected  void notifyJobStoreJobComplete(SchedulingContext ctxt, Trigger trigger, JobDetail detail, int instCode)
           
protected  void notifyJobStoreJobVetoed(SchedulingContext ctxt, Trigger trigger, JobDetail detail, int instCode)
           
 void notifySchedulerListenersError(java.lang.String msg, SchedulerException se)
           
 void notifySchedulerListenersFinalized(Trigger trigger)
           
 void notifySchedulerListenersInStandbyMode()
           
 void notifySchedulerListenersJobAdded(JobDetail jobDetail)
           
 void notifySchedulerListenersJobDeleted(java.lang.String jobName, java.lang.String groupName)
           
 void notifySchedulerListenersPausedJob(java.lang.String name, java.lang.String group)
           
 void notifySchedulerListenersPausedTrigger(java.lang.String name, java.lang.String group)
           
 void notifySchedulerListenersResumedJob(java.lang.String name, java.lang.String group)
           
 void notifySchedulerListenersResumedTrigger(java.lang.String name, java.lang.String group)
           
 void notifySchedulerListenersSchduled(Trigger trigger)
           
 void notifySchedulerListenersShutdown()
           
 void notifySchedulerListenersShuttingdown()
           
 void notifySchedulerListenersStarted()
           
 void notifySchedulerListenersUnscheduled(java.lang.String triggerName, java.lang.String triggerGroup)
           
protected  void notifySchedulerThread(long candidateNewNextFireTime)
           
 void notifyTriggerListenersComplete(JobExecutionContext jec, int instCode)
           
 boolean notifyTriggerListenersFired(JobExecutionContext jec)
           
 void notifyTriggerListenersMisfired(Trigger trigger)
           
 int numJobsExecuted()
           
 void pauseAll(SchedulingContext ctxt)
           Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group.
 void pauseJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName)
           Pause the JobDetail with the given name - by pausing all of its current Triggers.
 void pauseJobGroup(SchedulingContext ctxt, java.lang.String groupName)
           Pause all of the JobDetails in the given group - by pausing all of their Triggers.
 void pauseTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName)
           Pause the Trigger with the given name.
 void pauseTriggerGroup(SchedulingContext ctxt, java.lang.String groupName)
           Pause all of the Triggers in the given group.
 boolean removeGlobalJobListener(java.lang.String name)
           Remove the identified JobListener from the Scheduler's list of global listeners.
 boolean removeGlobalTriggerListener(java.lang.String name)
           Remove the identifed TriggerListener from the Scheduler's list of global listeners.
 boolean removeJobListener(java.lang.String name)
           Remove the identified JobListener from the Scheduler's list of registered listeners.
 boolean removeNoGCObject(java.lang.Object obj)
           
 boolean removeSchedulerListener(SchedulerListener schedulerListener)
           Remove the given SchedulerListener from the Scheduler.
 boolean removeTriggerListener(java.lang.String name)
           Remove the identified TriggerListener from the Scheduler's list of registered listeners.
 java.util.Date rescheduleJob(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName, 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(SchedulingContext ctxt)
           Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) on every group.
 void resumeJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName)
           Resume (un-pause) the JobDetail with the given name.
 void resumeJobGroup(SchedulingContext ctxt, java.lang.String groupName)
           Resume (un-pause) all of the JobDetails in the given group.
 void resumeTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName)
           Resume (un-pause) the Trigger with the given name.
 void resumeTriggerGroup(SchedulingContext ctxt, java.lang.String groupName)
           Resume (un-pause) all of the Triggers in the given group.
 java.util.Date runningSince()
           
 java.util.Date scheduleJob(SchedulingContext ctxt, JobDetail jobDetail, Trigger trigger)
           Add the Job identified by the given JobDetail to the Scheduler, and associate the given Trigger with it.
 java.util.Date scheduleJob(SchedulingContext ctxt, Trigger trigger)
           Schedule the given Trigger with the Job identified by the Trigger's settings.
 void setJobFactory(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(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName, JobDataMap data)
           Trigger the identified Job (execute it now) - with a non-volatile trigger.
 void triggerJobWithVolatileTrigger(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName, JobDataMap data)
           Trigger the identified Job (execute it now) - with a volatile trigger.
 boolean unscheduleJob(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName)
           Remove the indicated Trigger from the scheduler.
 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,
                       SchedulingContext ctxt,
                       long idleWaitTime,
                       long dbRetryInterval)
                throws SchedulerException

Create a QuartzScheduler with the given configuration properties.

Throws:
SchedulerException
See Also:
QuartzSchedulerResources
Method Detail

getDbRetryInterval

public long getDbRetryInterval()

initialize

public void initialize()
                throws SchedulerException
Throws:
SchedulerException

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface RemotableQuartzScheduler

getVersionMajor

public static java.lang.String getVersionMajor()

getVersionMinor

public static java.lang.String getVersionMinor()

getVersionIteration

public static java.lang.String getVersionIteration()

getSchedulerSignaler

public SchedulerSignaler getSchedulerSignaler()

getLog

public org.slf4j.Logger getLog()

getSchedulerName

public java.lang.String getSchedulerName()

Returns the name of the QuartzScheduler.

Specified by:
getSchedulerName in interface RemotableQuartzScheduler

getSchedulerInstanceId

public java.lang.String getSchedulerInstanceId()

Returns the instance Id of the QuartzScheduler.

Specified by:
getSchedulerInstanceId in interface RemotableQuartzScheduler

getSchedulerThreadGroup

public java.lang.ThreadGroup getSchedulerThreadGroup()

Returns the name of the QuartzScheduler.


addNoGCObject

public void addNoGCObject(java.lang.Object obj)

removeNoGCObject

public boolean removeNoGCObject(java.lang.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 java.util.Date runningSince()
Specified by:
runningSince in interface RemotableQuartzScheduler

numJobsExecuted

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

getJobStoreClass

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

isStarted

public boolean isStarted()

validateState

public void validateState()
                   throws SchedulerException
Throws:
SchedulerException

getCurrentlyExecutingJobs

public java.util.List 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 java.util.Date scheduleJob(SchedulingContext ctxt,
                                  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 java.util.Date scheduleJob(SchedulingContext ctxt,
                                  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(SchedulingContext ctxt,
                   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(SchedulingContext ctxt,
                         java.lang.String jobName,
                         java.lang.String groupName)
                  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.

unscheduleJob

public boolean unscheduleJob(SchedulingContext ctxt,
                             java.lang.String triggerName,
                             java.lang.String groupName)
                      throws SchedulerException

Remove the indicated Trigger from the scheduler.

Specified by:
unscheduleJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

rescheduleJob

public java.util.Date rescheduleJob(SchedulingContext ctxt,
                                    java.lang.String triggerName,
                                    java.lang.String groupName,
                                    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:
triggerName - The name of the Trigger to be removed.
groupName - The group name of the Trigger to be removed.
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(SchedulingContext ctxt,
                       java.lang.String jobName,
                       java.lang.String groupName,
                       JobDataMap data)
                throws SchedulerException

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

Specified by:
triggerJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

triggerJobWithVolatileTrigger

public void triggerJobWithVolatileTrigger(SchedulingContext ctxt,
                                          java.lang.String jobName,
                                          java.lang.String groupName,
                                          JobDataMap data)
                                   throws SchedulerException

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

Specified by:
triggerJobWithVolatileTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseTrigger

public void pauseTrigger(SchedulingContext ctxt,
                         java.lang.String triggerName,
                         java.lang.String groupName)
                  throws SchedulerException

Pause the Trigger with the given name.

Specified by:
pauseTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseTriggerGroup

public void pauseTriggerGroup(SchedulingContext ctxt,
                              java.lang.String groupName)
                       throws SchedulerException

Pause all of the Triggers in the given group.

Specified by:
pauseTriggerGroup in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseJob

public void pauseJob(SchedulingContext ctxt,
                     java.lang.String jobName,
                     java.lang.String groupName)
              throws SchedulerException

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

Specified by:
pauseJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseJobGroup

public void pauseJobGroup(SchedulingContext ctxt,
                          java.lang.String groupName)
                   throws SchedulerException

Pause all of the JobDetails in the given group - by pausing all of their Triggers.

Specified by:
pauseJobGroup in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeTrigger

public void resumeTrigger(SchedulingContext ctxt,
                          java.lang.String triggerName,
                          java.lang.String groupName)
                   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

resumeTriggerGroup

public void resumeTriggerGroup(SchedulingContext ctxt,
                               java.lang.String groupName)
                        throws SchedulerException

Resume (un-pause) all of the Triggers in the given group.

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

Specified by:
resumeTriggerGroup in interface RemotableQuartzScheduler
Throws:
SchedulerException

getPausedTriggerGroups

public java.util.Set getPausedTriggerGroups(SchedulingContext ctxt)
                                     throws SchedulerException
Specified by:
getPausedTriggerGroups in interface RemotableQuartzScheduler
Throws:
SchedulerException

resumeJob

public void resumeJob(SchedulingContext ctxt,
                      java.lang.String jobName,
                      java.lang.String groupName)
               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

resumeJobGroup

public void resumeJobGroup(SchedulingContext ctxt,
                           java.lang.String groupName)
                    throws SchedulerException

Resume (un-pause) all of the JobDetails in the given group.

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:
resumeJobGroup in interface RemotableQuartzScheduler
Throws:
SchedulerException

pauseAll

public void pauseAll(SchedulingContext ctxt)
              throws SchedulerException

Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group.

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

Specified by:
pauseAll in interface RemotableQuartzScheduler
Throws:
SchedulerException
See Also:
resumeAll(SchedulingContext), pauseTriggerGroup(SchedulingContext, String), standby()

resumeAll

public void resumeAll(SchedulingContext ctxt)
               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(SchedulingContext)

getJobGroupNames

public java.lang.String[] getJobGroupNames(SchedulingContext ctxt)
                                    throws SchedulerException

Get the names of all known Job groups.

Specified by:
getJobGroupNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getJobNames

public java.lang.String[] getJobNames(SchedulingContext ctxt,
                                      java.lang.String groupName)
                               throws SchedulerException

Get the names of all the Jobs in the given group.

Specified by:
getJobNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggersOfJob

public Trigger[] getTriggersOfJob(SchedulingContext ctxt,
                                  java.lang.String jobName,
                                  java.lang.String groupName)
                           throws SchedulerException

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

Specified by:
getTriggersOfJob in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerGroupNames

public java.lang.String[] getTriggerGroupNames(SchedulingContext ctxt)
                                        throws SchedulerException

Get the names of all known Trigger groups.

Specified by:
getTriggerGroupNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerNames

public java.lang.String[] getTriggerNames(SchedulingContext ctxt,
                                          java.lang.String groupName)
                                   throws SchedulerException

Get the names of all the Triggers in the given group.

Specified by:
getTriggerNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

getJobDetail

public JobDetail getJobDetail(SchedulingContext ctxt,
                              java.lang.String jobName,
                              java.lang.String jobGroup)
                       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(SchedulingContext ctxt,
                          java.lang.String triggerName,
                          java.lang.String triggerGroup)
                   throws SchedulerException

Get the Trigger instance with the given name and group.

Specified by:
getTrigger in interface RemotableQuartzScheduler
Throws:
SchedulerException

getTriggerState

public int getTriggerState(SchedulingContext ctxt,
                           java.lang.String triggerName,
                           java.lang.String triggerGroup)
                    throws SchedulerException

Get the current state of the identified Trigger.

Specified by:
getTriggerState in interface RemotableQuartzScheduler
Throws:
SchedulerException
See Also:
Trigger.STATE_NORMAL, Trigger.STATE_PAUSED, Trigger.STATE_COMPLETE, Trigger.STATE_ERROR

addCalendar

public void addCalendar(SchedulingContext ctxt,
                        java.lang.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(SchedulingContext ctxt,
                              java.lang.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(SchedulingContext ctxt,
                            java.lang.String calName)
                     throws SchedulerException

Get the Calendar instance with the given name.

Specified by:
getCalendar in interface RemotableQuartzScheduler
Throws:
SchedulerException

getCalendarNames

public java.lang.String[] getCalendarNames(SchedulingContext ctxt)
                                    throws SchedulerException

Get the names of all registered Calendars.

Specified by:
getCalendarNames in interface RemotableQuartzScheduler
Throws:
SchedulerException

addGlobalJobListener

public void addGlobalJobListener(JobListener jobListener)

Add the given JobListener to the Scheduler'sglobal list.

Listeners in the 'global' list receive notification of execution events for ALL Jobs.

Specified by:
addGlobalJobListener in interface RemotableQuartzScheduler

addJobListener

public void addJobListener(JobListener jobListener)

Add the given JobListener to the Scheduler's list, of registered JobListeners.

Specified by:
addJobListener in interface RemotableQuartzScheduler

removeGlobalJobListener

public boolean removeGlobalJobListener(java.lang.String name)

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

Specified by:
removeGlobalJobListener in interface RemotableQuartzScheduler
Returns:
true if the identified listener was found in the list, and removed.

removeJobListener

public boolean removeJobListener(java.lang.String name)

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

Specified by:
removeJobListener in interface RemotableQuartzScheduler
Returns:
true if the identifed listener was found in the list, and removed.

getGlobalJobListeners

public java.util.List getGlobalJobListeners()

Get a List containing all of the JobListener s in the Scheduler'sglobal list.

Specified by:
getGlobalJobListeners in interface RemotableQuartzScheduler

getJobListenerNames

public java.util.Set getJobListenerNames()

Get a Set containing the names of all the non-globalJobListener s registered with the Scheduler.

Specified by:
getJobListenerNames in interface RemotableQuartzScheduler

getGlobalJobListener

public JobListener getGlobalJobListener(java.lang.String name)

Get the globalJobListener that has the given name.

Specified by:
getGlobalJobListener in interface RemotableQuartzScheduler

getJobListener

public JobListener getJobListener(java.lang.String name)

Get the non-globalJobListener that has the given name.

Specified by:
getJobListener in interface RemotableQuartzScheduler

addGlobalTriggerListener

public void addGlobalTriggerListener(TriggerListener triggerListener)

Add the given TriggerListener to the Scheduler'sglobal list.

Listeners in the 'global' list receive notification of execution events for ALL Triggers.

Specified by:
addGlobalTriggerListener in interface RemotableQuartzScheduler

addTriggerListener

public void addTriggerListener(TriggerListener triggerListener)

Add the given TriggerListener to the Scheduler's list, of registered TriggerListeners.

Specified by:
addTriggerListener in interface RemotableQuartzScheduler

removeGlobalTriggerListener

public boolean removeGlobalTriggerListener(java.lang.String name)

Remove the identifed TriggerListener from the Scheduler's list of global listeners.

Specified by:
removeGlobalTriggerListener in interface RemotableQuartzScheduler
Returns:
true if the identifed listener was found in the list, and removed.

removeTriggerListener

public boolean removeTriggerListener(java.lang.String name)

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

Specified by:
removeTriggerListener in interface RemotableQuartzScheduler
Returns:
true if the identified listener was found in the list, and removed.

getGlobalTriggerListeners

public java.util.List getGlobalTriggerListeners()

Get a list containing all of the TriggerListener s in the Scheduler'sglobal list.

Specified by:
getGlobalTriggerListeners in interface RemotableQuartzScheduler

getTriggerListenerNames

public java.util.Set getTriggerListenerNames()

Get a Set containing the names of all the non-globalTriggerListener s registered with the Scheduler.

Specified by:
getTriggerListenerNames in interface RemotableQuartzScheduler

getGlobalTriggerListener

public TriggerListener getGlobalTriggerListener(java.lang.String name)

Get the globalTriggerListener that has the given name.

Specified by:
getGlobalTriggerListener in interface RemotableQuartzScheduler

getTriggerListener

public TriggerListener getTriggerListener(java.lang.String name)

Get the non-globalTriggerListener that has the given name.

Specified by:
getTriggerListener in interface RemotableQuartzScheduler

addSchedulerListener

public void addSchedulerListener(SchedulerListener schedulerListener)

Register the given SchedulerListener with the Scheduler.

Specified by:
addSchedulerListener in interface RemotableQuartzScheduler

removeSchedulerListener

public boolean removeSchedulerListener(SchedulerListener schedulerListener)

Remove the given SchedulerListener from the Scheduler.

Specified by:
removeSchedulerListener in interface RemotableQuartzScheduler
Returns:
true if the identified listener was found in the list, and removed.

getSchedulerListeners

public java.util.List getSchedulerListeners()

Get a List containing all of the SchedulerListener s registered with the Scheduler.

Specified by:
getSchedulerListeners in interface RemotableQuartzScheduler

notifyJobStoreJobComplete

protected void notifyJobStoreJobComplete(SchedulingContext ctxt,
                                         Trigger trigger,
                                         JobDetail detail,
                                         int instCode)
                                  throws JobPersistenceException
Throws:
JobPersistenceException

notifyJobStoreJobVetoed

protected void notifyJobStoreJobVetoed(SchedulingContext ctxt,
                                       Trigger trigger,
                                       JobDetail detail,
                                       int 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,
                                           int 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(java.lang.String msg,
                                          SchedulerException se)

notifySchedulerListenersSchduled

public void notifySchedulerListenersSchduled(Trigger trigger)

notifySchedulerListenersUnscheduled

public void notifySchedulerListenersUnscheduled(java.lang.String triggerName,
                                                java.lang.String triggerGroup)

notifySchedulerListenersFinalized

public void notifySchedulerListenersFinalized(Trigger trigger)

notifySchedulerListenersPausedTrigger

public void notifySchedulerListenersPausedTrigger(java.lang.String name,
                                                  java.lang.String group)

notifySchedulerListenersResumedTrigger

public void notifySchedulerListenersResumedTrigger(java.lang.String name,
                                                   java.lang.String group)

notifySchedulerListenersPausedJob

public void notifySchedulerListenersPausedJob(java.lang.String name,
                                              java.lang.String group)

notifySchedulerListenersResumedJob

public void notifySchedulerListenersResumedJob(java.lang.String name,
                                               java.lang.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(java.lang.String jobName,
                                               java.lang.String groupName)

setJobFactory

public void setJobFactory(JobFactory factory)
                   throws SchedulerException
Throws:
SchedulerException

getJobFactory

public JobFactory getJobFactory()

interrupt

public boolean interrupt(SchedulingContext ctxt,
                         java.lang.String jobName,
                         java.lang.String groupName)
                  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(org.quartz.core.SchedulingContext, java.lang.String, java.lang.String)


Copyright 2001-2019, Terracotta, Inc.