Class QuartzScheduler
- java.lang.Object
-
- 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
interface, containing methods to scheduleSchedulers, registerJobinstances, etc.JobListener- Author:
- James House
- See Also:
Scheduler,QuartzSchedulerThread,JobStore,ThreadPool
-
-
Constructor Summary
Constructors Constructor Description QuartzScheduler(QuartzSchedulerResources resources, long idleWaitTime, long dbRetryInterval)Create aQuartzSchedulerwith the given configuration properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCalendar(java.lang.String calName, Calendar calendar, boolean replace, boolean updateTriggers)Add (register) the givenCalendarto the Scheduler.voidaddInternalJobListener(JobListener jobListener)Add the givento theJobListenerScheduler's internal list.voidaddInternalSchedulerListener(SchedulerListener schedulerListener)Register the givenwith theSchedulerListenerScheduler's list of internal listeners.voidaddInternalTriggerListener(TriggerListener triggerListener)Add the givento theTriggerListenerScheduler's internal list.voidaddJob(JobDetail jobDetail, boolean replace)Add the givenJobto the Scheduler - with no associatedTrigger.voidaddJob(JobDetail jobDetail, boolean replace, boolean storeNonDurableWhileAwaitingScheduling)voidaddNoGCObject(java.lang.Object obj)booleancheckExists(JobKey jobKey)Determine whether aJobwith the given identifier already exists within the scheduler.booleancheckExists(TriggerKey triggerKey)Determine whether aTriggerwith the given identifier already exists within the scheduler.voidclear()booleandeleteCalendar(java.lang.String calName)Delete the identifiedCalendarfrom the Scheduler.booleandeleteJob(JobKey jobKey)Delete the identifiedJobfrom the Scheduler - and any associatedTriggers.booleandeleteJobs(java.util.List<JobKey> jobKeys)CalendargetCalendar(java.lang.String calName)Get theinstance with the given name.Calendarjava.util.List<java.lang.String>getCalendarNames()Get the names of all registered.Calendarsjava.util.List<JobExecutionContext>getCurrentlyExecutingJobs()Return a list ofJobExecutionContextobjects that represent all currently executing Jobs in this Scheduler instance.JobListenergetInternalJobListener(java.lang.String name)Get the internalthat has the given name.JobListenerjava.util.List<JobListener>getInternalJobListeners()Get a List containing all of thes in theJobListenerScheduler's internal list.java.util.List<SchedulerListener>getInternalSchedulerListeners()Get a List containing all of the internals registered with theSchedulerListenerScheduler.TriggerListenergetInternalTriggerListener(java.lang.String name)Get the internalthat has the given name.TriggerListenerjava.util.List<TriggerListener>getInternalTriggerListeners()Get a list containing all of thes in theTriggerListenerScheduler's internal list.JobDetailgetJobDetail(JobKey jobKey)Get thefor theJobDetailJobinstance with the given name and group.JobFactorygetJobFactory()java.util.List<java.lang.String>getJobGroupNames()Get the names of all knowngroups.Jobjava.util.Set<JobKey>getJobKeys(GroupMatcher<JobKey> matcher)Get the names of all thein the matching groups.Jobsjava.lang.Class<?>getJobStoreClass()ListenerManagergetListenerManager()org.slf4j.LoggergetLog()java.util.Set<java.lang.String>getPausedTriggerGroups()SchedulerContextgetSchedulerContext()Returns theSchedulerContextof theScheduler.java.lang.StringgetSchedulerInstanceId()Returns the instance Id of theQuartzScheduler.java.lang.StringgetSchedulerName()Returns the name of theQuartzScheduler.SchedulerSignalergetSchedulerSignaler()java.lang.ThreadGroupgetSchedulerThreadGroup()Returns the name of the thread group for Quartz's main threads.java.lang.Class<?>getThreadPoolClass()intgetThreadPoolSize()TriggergetTrigger(TriggerKey triggerKey)Get theinstance with the given name and group.Triggerjava.util.List<java.lang.String>getTriggerGroupNames()Get the names of all knowngroups.Triggerjava.util.Set<TriggerKey>getTriggerKeys(GroupMatcher<TriggerKey> matcher)Get the names of all thein the matching groups.Triggersjava.util.List<? extends Trigger>getTriggersOfJob(JobKey jobKey)Trigger.TriggerStategetTriggerState(TriggerKey triggerKey)Get the current state of the identified.Triggerjava.lang.StringgetVersion()static java.lang.StringgetVersionIteration()static java.lang.StringgetVersionMajor()static java.lang.StringgetVersionMinor()voidinitialize()booleaninterrupt(java.lang.String fireInstanceId)Interrupt the identified InterruptableJob executing in this Scheduler instance.booleaninterrupt(JobKey jobKey)Interrupt all instances of the identified InterruptableJob executing in this Scheduler instance.booleanisClustered()booleanisInStandbyMode()Reports whether theScheduleris paused.booleanisShutdown()Reports whether theSchedulerhas been shutdown.booleanisShuttingDown()booleanisSignalOnSchedulingChange()booleanisStarted()voidnotifyJobListenersToBeExecuted(JobExecutionContext jec)voidnotifyJobListenersWasExecuted(JobExecutionContext jec, JobExecutionException je)voidnotifyJobListenersWasVetoed(JobExecutionContext jec)protected voidnotifyJobStoreJobComplete(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)protected voidnotifyJobStoreJobVetoed(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)voidnotifySchedulerListenersError(java.lang.String msg, SchedulerException se)voidnotifySchedulerListenersFinalized(Trigger trigger)voidnotifySchedulerListenersInStandbyMode()voidnotifySchedulerListenersJobAdded(JobDetail jobDetail)voidnotifySchedulerListenersJobDeleted(JobKey jobKey)voidnotifySchedulerListenersPausedJob(JobKey key)voidnotifySchedulerListenersPausedJobs(java.lang.String group)voidnotifySchedulerListenersPausedTrigger(TriggerKey triggerKey)voidnotifySchedulerListenersPausedTriggers(java.lang.String group)voidnotifySchedulerListenersResumedJob(JobKey key)voidnotifySchedulerListenersResumedJobs(java.lang.String group)voidnotifySchedulerListenersResumedTrigger(TriggerKey key)voidnotifySchedulerListenersResumedTriggers(java.lang.String group)voidnotifySchedulerListenersScheduled(Trigger trigger)voidnotifySchedulerListenersShutdown()voidnotifySchedulerListenersShuttingdown()voidnotifySchedulerListenersStarted()voidnotifySchedulerListenersStarting()voidnotifySchedulerListenersUnscheduled(TriggerKey triggerKey)protected voidnotifySchedulerThread(long candidateNewNextFireTime)voidnotifyTriggerListenersComplete(JobExecutionContext jec, Trigger.CompletedExecutionInstruction instCode)booleannotifyTriggerListenersFired(JobExecutionContext jec)voidnotifyTriggerListenersMisfired(Trigger trigger)intnumJobsExecuted()voidpauseAll()Pause all triggers - equivalent of callingpauseTriggers(GroupMatcher)with a matcher matching all known groups.voidpauseJob(JobKey jobKey)Pause thewith the given name - by pausing all of its currentJobDetailTriggers.voidpauseJobs(GroupMatcher<JobKey> groupMatcher)Pause all of thein the matching groups - by pausing all of theirJobDetailsTriggers.voidpauseTrigger(TriggerKey triggerKey)Pause thewith the given name.TriggervoidpauseTriggers(GroupMatcher<TriggerKey> matcher)Pause all of thein the matching groups.TriggersbooleanremoveInternalJobListener(java.lang.String name)Remove the identifiedfrom theJobListenerScheduler's list of internal listeners.booleanremoveInternalSchedulerListener(SchedulerListener schedulerListener)Remove the givenfrom theSchedulerListenerScheduler's list of internal listeners.booleanremoveinternalTriggerListener(java.lang.String name)Remove the identifiedfrom theTriggerListenerScheduler's list of internal listeners.booleanremoveNoGCObject(java.lang.Object obj)java.util.DaterescheduleJob(TriggerKey triggerKey, Trigger newTrigger)Remove (delete) thewith the given name, and store the new given one - which must be associated with the same job.TriggervoidresetTriggerFromErrorState(TriggerKey triggerKey)voidresumeAll()Resume (un-pause) all triggers - equivalent of callingresumeTriggerGroup(group)on every group.voidresumeJob(JobKey jobKey)Resume (un-pause) thewith the given name.JobDetailvoidresumeJobs(GroupMatcher<JobKey> matcher)Resume (un-pause) all of thein the matching groups.JobDetailsvoidresumeTrigger(TriggerKey triggerKey)Resume (un-pause) thewith the given name.TriggervoidresumeTriggers(GroupMatcher<TriggerKey> matcher)Resume (un-pause) all of thein the matching groups.Triggersjava.util.DaterunningSince()voidscheduleJob(JobDetail jobDetail, java.util.Set<? extends Trigger> triggersForJob, boolean replace)java.util.DatescheduleJob(JobDetail jobDetail, Trigger trigger)java.util.DatescheduleJob(Trigger trigger)voidscheduleJobs(java.util.Map<JobDetail,java.util.Set<? extends Trigger>> triggersAndJobs, boolean replace)voidsetJobFactory(JobFactory factory)voidsetSignalOnSchedulingChange(boolean signalOnSchedulingChange)voidshutdown()Halts theQuartzScheduler's firing of, and cleans up all resources associated with the QuartzScheduler.Triggersvoidshutdown(boolean waitForJobsToComplete)Halts theQuartzScheduler's firing of, and cleans up all resources associated with the QuartzScheduler.Triggersvoidstandby()Temporarily halts theQuartzScheduler's firing of.Triggersvoidstart()Starts theQuartzScheduler's threads that fire.TriggersvoidstartDelayed(int seconds)booleansupportsPersistence()voidtriggerJob(JobKey jobKey, JobDataMap data)Trigger the identified(execute it now) - with a non-volatile trigger.JobvoidtriggerJob(OperableTrigger trig)Store and schedule the identifiedOperableTriggerbooleanunscheduleJob(TriggerKey triggerKey)Remove the indicatedfrom the scheduler.TriggerbooleanunscheduleJobs(java.util.List<TriggerKey> triggerKeys)voidvalidateState()
-
-
-
Constructor Detail
-
QuartzScheduler
public QuartzScheduler(QuartzSchedulerResources resources, long idleWaitTime, @Deprecated long dbRetryInterval) throws SchedulerException
Create a
QuartzSchedulerwith the given configuration properties.- Throws:
SchedulerException- See Also:
QuartzSchedulerResources
-
-
Method Detail
-
initialize
public void initialize() throws SchedulerException- Throws:
SchedulerException
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersionin interfaceRemotableQuartzScheduler
-
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:
getSchedulerNamein interfaceRemotableQuartzScheduler
-
getSchedulerInstanceId
public java.lang.String getSchedulerInstanceId()
Returns the instance Id of the
QuartzScheduler.- Specified by:
getSchedulerInstanceIdin interfaceRemotableQuartzScheduler
-
getSchedulerThreadGroup
public java.lang.ThreadGroup getSchedulerThreadGroup()
Returns the name of the thread group for Quartz's main threads.
-
addNoGCObject
public void addNoGCObject(java.lang.Object obj)
-
removeNoGCObject
public boolean removeNoGCObject(java.lang.Object obj)
-
getSchedulerContext
public SchedulerContext getSchedulerContext() throws SchedulerException
Returns the
SchedulerContextof theScheduler.- Specified by:
getSchedulerContextin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
isSignalOnSchedulingChange
public boolean isSignalOnSchedulingChange()
-
setSignalOnSchedulingChange
public void setSignalOnSchedulingChange(boolean signalOnSchedulingChange)
-
start
public void start() throws SchedulerExceptionStarts the
QuartzScheduler's threads that fire.TriggersAll
that have misfired will be passed to the appropriate TriggerListener(s).Triggers- Specified by:
startin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
startDelayed
public void startDelayed(int seconds) throws SchedulerException- Specified by:
startDelayedin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
standby
public void standby()
Temporarily halts the
QuartzScheduler's firing of.TriggersThe scheduler is not destroyed, and can be re-started at any time.
- Specified by:
standbyin interfaceRemotableQuartzScheduler
-
isInStandbyMode
public boolean isInStandbyMode()
Reports whether the
Scheduleris paused.- Specified by:
isInStandbyModein interfaceRemotableQuartzScheduler
-
runningSince
public java.util.Date runningSince()
- Specified by:
runningSincein interfaceRemotableQuartzScheduler
-
numJobsExecuted
public int numJobsExecuted()
- Specified by:
numJobsExecutedin interfaceRemotableQuartzScheduler
-
getJobStoreClass
public java.lang.Class<?> getJobStoreClass()
- Specified by:
getJobStoreClassin interfaceRemotableQuartzScheduler
-
supportsPersistence
public boolean supportsPersistence()
- Specified by:
supportsPersistencein interfaceRemotableQuartzScheduler
-
isClustered
public boolean isClustered()
- Specified by:
isClusteredin interfaceRemotableQuartzScheduler
-
getThreadPoolClass
public java.lang.Class<?> getThreadPoolClass()
- Specified by:
getThreadPoolClassin interfaceRemotableQuartzScheduler
-
getThreadPoolSize
public int getThreadPoolSize()
- Specified by:
getThreadPoolSizein interfaceRemotableQuartzScheduler
-
shutdown
public void shutdown()
Halts the
QuartzScheduler's firing of, and cleans up all resources associated with the QuartzScheduler. Equivalent toTriggersshutdown(false).The scheduler cannot be re-started.
- Specified by:
shutdownin interfaceRemotableQuartzScheduler
-
shutdown
public void shutdown(boolean waitForJobsToComplete)
Halts the
QuartzScheduler's firing of, and cleans up all resources associated with the QuartzScheduler.TriggersThe scheduler cannot be re-started.
- Specified by:
shutdownin interfaceRemotableQuartzScheduler- Parameters:
waitForJobsToComplete- iftruethe scheduler will not allow this method to return until all currently executing jobs have completed.
-
isShutdown
public boolean isShutdown()
Reports whether the
Schedulerhas been shutdown.- Specified by:
isShutdownin interfaceRemotableQuartzScheduler
-
isShuttingDown
public boolean isShuttingDown()
-
isStarted
public boolean isStarted()
-
validateState
public void validateState() throws SchedulerException- Throws:
SchedulerException
-
getCurrentlyExecutingJobs
public java.util.List<JobExecutionContext> getCurrentlyExecutingJobs()
Return a list of
JobExecutionContextobjects 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:
getCurrentlyExecutingJobsin interfaceRemotableQuartzScheduler
-
scheduleJob
public java.util.Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException
Add the
identified by the givenJobto the Scheduler, and associate the givenJobDetailwith it.TriggerIf 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:
scheduleJobin interfaceRemotableQuartzScheduler- 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(Trigger trigger) throws SchedulerException
Schedule the given
with theTriggerJobidentified by theTrigger's settings.- Specified by:
scheduleJobin interfaceRemotableQuartzScheduler- 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
Jobto the Scheduler - with no associatedTrigger. TheJobwill be 'dormant' until it is scheduled with aTrigger, orScheduler.triggerJob()is called for it.The
Jobmust by definition be 'durable', if it is not, SchedulerException will be thrown.- Specified by:
addJobin interfaceRemotableQuartzScheduler- 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, andreplaceisfalse.
-
addJob
public void addJob(JobDetail jobDetail, boolean replace, boolean storeNonDurableWhileAwaitingScheduling) throws SchedulerException
- Specified by:
addJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
deleteJob
public boolean deleteJob(JobKey jobKey) throws SchedulerException
Delete the identified
Jobfrom the Scheduler - and any associatedTriggers.- Specified by:
deleteJobin interfaceRemotableQuartzScheduler- Returns:
- true if the Job was found and deleted.
- Throws:
SchedulerException- if there is an internal Scheduler error.
-
deleteJobs
public boolean deleteJobs(java.util.List<JobKey> jobKeys) throws SchedulerException
- Specified by:
deleteJobsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
scheduleJobs
public void scheduleJobs(java.util.Map<JobDetail,java.util.Set<? extends Trigger>> triggersAndJobs, boolean replace) throws SchedulerException
- Specified by:
scheduleJobsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
scheduleJob
public void scheduleJob(JobDetail jobDetail, java.util.Set<? extends Trigger> triggersForJob, boolean replace) throws SchedulerException
- Specified by:
scheduleJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
unscheduleJobs
public boolean unscheduleJobs(java.util.List<TriggerKey> triggerKeys) throws SchedulerException
- Specified by:
unscheduleJobsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
unscheduleJob
public boolean unscheduleJob(TriggerKey triggerKey) throws SchedulerException
Remove the indicated
from the scheduler.Trigger- Specified by:
unscheduleJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
rescheduleJob
public java.util.Date rescheduleJob(TriggerKey triggerKey, Trigger newTrigger) throws SchedulerException
Remove (delete) the
with the given name, and store the new given one - which must be associated with the same job.Trigger- Specified by:
rescheduleJobin interfaceRemotableQuartzScheduler- Parameters:
newTrigger- The newTriggerto be stored.- Returns:
nullif aTriggerwith the given name and 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
(execute it now) - with a non-volatile trigger.Job- Specified by:
triggerJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
triggerJob
public void triggerJob(OperableTrigger trig) throws SchedulerException
Store and schedule the identified
OperableTrigger- Specified by:
triggerJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
pauseTrigger
public void pauseTrigger(TriggerKey triggerKey) throws SchedulerException
Pause the
with the given name.Trigger- Specified by:
pauseTriggerin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
pauseTriggers
public void pauseTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException
Pause all of the
in the matching groups.Triggers- Specified by:
pauseTriggersin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
pauseJob
public void pauseJob(JobKey jobKey) throws SchedulerException
Pause the
with the given name - by pausing all of its currentJobDetailTriggers.- Specified by:
pauseJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
pauseJobs
public void pauseJobs(GroupMatcher<JobKey> groupMatcher) throws SchedulerException
Pause all of the
in the matching groups - by pausing all of theirJobDetailsTriggers.- Specified by:
pauseJobsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
resumeTrigger
public void resumeTrigger(TriggerKey triggerKey) throws SchedulerException
Resume (un-pause) the
with the given name.TriggerIf the
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeTriggerin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
resumeTriggers
public void resumeTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException
Resume (un-pause) all of the
in the matching groups.TriggersIf any
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeTriggersin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getPausedTriggerGroups
public java.util.Set<java.lang.String> getPausedTriggerGroups() throws SchedulerException- Specified by:
getPausedTriggerGroupsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
resumeJob
public void resumeJob(JobKey jobKey) throws SchedulerException
Resume (un-pause) the
with the given name.JobDetailIf any of the
Job'sTriggers missed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
resumeJobs
public void resumeJobs(GroupMatcher<JobKey> matcher) throws SchedulerException
Resume (un-pause) all of the
in the matching groups.JobDetailsIf any of the
Jobs hadTriggers that missed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeJobsin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
pauseAll
public void pauseAll() throws SchedulerExceptionPause 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:
pauseAllin interfaceRemotableQuartzScheduler- Throws:
SchedulerException- See Also:
resumeAll(),pauseTriggers(org.quartz.impl.matchers.GroupMatcher),standby()
-
resumeAll
public void resumeAll() throws SchedulerExceptionResume (un-pause) all triggers - equivalent of calling
resumeTriggerGroup(group)on every group.If any
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeAllin interfaceRemotableQuartzScheduler- Throws:
SchedulerException- See Also:
pauseAll()
-
getJobGroupNames
public java.util.List<java.lang.String> getJobGroupNames() throws SchedulerExceptionGet the names of all known
groups.Job- Specified by:
getJobGroupNamesin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getJobKeys
public java.util.Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher) throws SchedulerException
Get the names of all the
in the matching groups.Jobs- Specified by:
getJobKeysin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getTriggersOfJob
public java.util.List<? extends Trigger> getTriggersOfJob(JobKey jobKey) throws SchedulerException
- Specified by:
getTriggersOfJobin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getTriggerGroupNames
public java.util.List<java.lang.String> getTriggerGroupNames() throws SchedulerExceptionGet the names of all known
groups.Trigger- Specified by:
getTriggerGroupNamesin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getTriggerKeys
public java.util.Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher) throws SchedulerException
Get the names of all the
in the matching groups.Triggers- Specified by:
getTriggerKeysin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getJobDetail
public JobDetail getJobDetail(JobKey jobKey) throws SchedulerException
Get the
for theJobDetailJobinstance with the given name and group.- Specified by:
getJobDetailin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getTrigger
public Trigger getTrigger(TriggerKey triggerKey) throws SchedulerException
Get the
instance with the given name and group.Trigger- Specified by:
getTriggerin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
checkExists
public boolean checkExists(JobKey jobKey) throws SchedulerException
Determine whether aJobwith the given identifier already exists within the scheduler.- Specified by:
checkExistsin interfaceRemotableQuartzScheduler- 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 aTriggerwith the given identifier already exists within the scheduler.- Specified by:
checkExistsin interfaceRemotableQuartzScheduler- 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- Specified by:
clearin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getTriggerState
public Trigger.TriggerState getTriggerState(TriggerKey triggerKey) throws SchedulerException
Get the current state of the identified
J *.Trigger- Specified by:
getTriggerStatein interfaceRemotableQuartzScheduler- Throws:
SchedulerException- See Also:
Trigger.TriggerState
-
resetTriggerFromErrorState
public void resetTriggerFromErrorState(TriggerKey triggerKey) throws SchedulerException
- Specified by:
resetTriggerFromErrorStatein interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
addCalendar
public void addCalendar(java.lang.String calName, Calendar calendar, boolean replace, boolean updateTriggers) throws SchedulerExceptionAdd (register) the given
Calendarto the Scheduler.- Specified by:
addCalendarin interfaceRemotableQuartzScheduler- Throws:
SchedulerException- if there is an internal Scheduler error, or a Calendar with the same name already exists, andreplaceisfalse.
-
deleteCalendar
public boolean deleteCalendar(java.lang.String calName) throws SchedulerExceptionDelete the identified
Calendarfrom the Scheduler.- Specified by:
deleteCalendarin interfaceRemotableQuartzScheduler- Returns:
- true if the Calendar was found and deleted.
- Throws:
SchedulerException- if there is an internal Scheduler error.
-
getCalendar
public Calendar getCalendar(java.lang.String calName) throws SchedulerException
Get the
instance with the given name.Calendar- Specified by:
getCalendarin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getCalendarNames
public java.util.List<java.lang.String> getCalendarNames() throws SchedulerExceptionGet the names of all registered
.Calendars- Specified by:
getCalendarNamesin interfaceRemotableQuartzScheduler- Throws:
SchedulerException
-
getListenerManager
public ListenerManager getListenerManager()
-
addInternalJobListener
public void addInternalJobListener(JobListener jobListener)
Add the given
to theJobListenerScheduler's internal list.
-
removeInternalJobListener
public boolean removeInternalJobListener(java.lang.String name)
Remove the identified
from theJobListenerScheduler's list of internal listeners.- Returns:
- true if the identified listener was found in the list, and removed.
-
getInternalJobListeners
public java.util.List<JobListener> getInternalJobListeners()
Get a List containing all of the
s in theJobListenerScheduler's internal list.
-
getInternalJobListener
public JobListener getInternalJobListener(java.lang.String name)
Get the internal
that has the given name.JobListener
-
addInternalTriggerListener
public void addInternalTriggerListener(TriggerListener triggerListener)
Add the given
to theTriggerListenerScheduler's internal list.
-
removeinternalTriggerListener
public boolean removeinternalTriggerListener(java.lang.String name)
Remove the identified
from theTriggerListenerScheduler's list of internal listeners.- Returns:
- true if the identified listener was found in the list, and removed.
-
getInternalTriggerListeners
public java.util.List<TriggerListener> getInternalTriggerListeners()
Get a list containing all of the
s in theTriggerListenerScheduler's internal list.
-
getInternalTriggerListener
public TriggerListener getInternalTriggerListener(java.lang.String name)
Get the internal
that has the given name.TriggerListener
-
addInternalSchedulerListener
public void addInternalSchedulerListener(SchedulerListener schedulerListener)
Register the given
with theSchedulerListenerScheduler's list of internal listeners.
-
removeInternalSchedulerListener
public boolean removeInternalSchedulerListener(SchedulerListener schedulerListener)
Remove the given
from theSchedulerListenerScheduler's list of internal listeners.- Returns:
- true if the identified listener was found in the list, and removed.
-
getInternalSchedulerListeners
public java.util.List<SchedulerListener> getInternalSchedulerListeners()
Get a List containing all of the internal
s registered with theSchedulerListenerScheduler.
-
notifyJobStoreJobComplete
protected void notifyJobStoreJobComplete(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)
-
notifyJobStoreJobVetoed
protected void notifyJobStoreJobVetoed(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode)
-
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(java.lang.String msg, SchedulerException se)
-
notifySchedulerListenersScheduled
public void notifySchedulerListenersScheduled(Trigger trigger)
-
notifySchedulerListenersUnscheduled
public void notifySchedulerListenersUnscheduled(TriggerKey triggerKey)
-
notifySchedulerListenersFinalized
public void notifySchedulerListenersFinalized(Trigger trigger)
-
notifySchedulerListenersPausedTrigger
public void notifySchedulerListenersPausedTrigger(TriggerKey triggerKey)
-
notifySchedulerListenersPausedTriggers
public void notifySchedulerListenersPausedTriggers(java.lang.String group)
-
notifySchedulerListenersResumedTrigger
public void notifySchedulerListenersResumedTrigger(TriggerKey key)
-
notifySchedulerListenersResumedTriggers
public void notifySchedulerListenersResumedTriggers(java.lang.String group)
-
notifySchedulerListenersPausedJob
public void notifySchedulerListenersPausedJob(JobKey key)
-
notifySchedulerListenersPausedJobs
public void notifySchedulerListenersPausedJobs(java.lang.String group)
-
notifySchedulerListenersResumedJob
public void notifySchedulerListenersResumedJob(JobKey key)
-
notifySchedulerListenersResumedJobs
public void notifySchedulerListenersResumedJobs(java.lang.String group)
-
notifySchedulerListenersInStandbyMode
public void notifySchedulerListenersInStandbyMode()
-
notifySchedulerListenersStarted
public void notifySchedulerListenersStarted()
-
notifySchedulerListenersStarting
public void notifySchedulerListenersStarting()
-
notifySchedulerListenersShutdown
public void notifySchedulerListenersShutdown()
-
notifySchedulerListenersShuttingdown
public void notifySchedulerListenersShuttingdown()
-
notifySchedulerListenersJobAdded
public void notifySchedulerListenersJobAdded(JobDetail jobDetail)
-
notifySchedulerListenersJobDeleted
public void notifySchedulerListenersJobDeleted(JobKey jobKey)
-
setJobFactory
public void setJobFactory(JobFactory factory) throws SchedulerException
- Throws:
SchedulerException
-
getJobFactory
public 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:
interruptin interfaceRemotableQuartzScheduler- Throws:
UnableToInterruptJobException- See Also:
RemotableQuartzScheduler.interrupt(JobKey)
-
interrupt
public boolean interrupt(java.lang.String fireInstanceId) throws UnableToInterruptJobExceptionInterrupt 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:
interruptin interfaceRemotableQuartzScheduler- Throws:
UnableToInterruptJobException- See Also:
RemotableQuartzScheduler.interrupt(JobKey)
-
-