| Constructor and Description |
|---|
QuartzScheduler(QuartzSchedulerResources quartzSchedulerResources)
Create a
QuartzScheduler with the given configuration properties. |
| Modifier and Type | Method and Description |
|---|---|
void |
addInternalSchedulerListener(SchedulerListener schedulerListener)
Register the given
with the Scheduler's list of internal listeners. |
void |
addJob(JobDetail jobDetail)
Add the given
Job to the Scheduler - with no associated Trigger. |
void |
deleteJob(String jobKey)
Delete the identified
Job from the Scheduler - and any associated Triggers. |
CascadingClassLoadHelper |
getCascadingClassLoadHelper() |
List<JobExecutionContext> |
getCurrentlyExecutingJobs()
Return a list of
JobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance. |
List<JobListener> |
getInternalJobListeners()
Get a List containing all of the
s in the Scheduler's internal list. |
List<SchedulerListener> |
getInternalSchedulerListeners()
Get a List containing all of the internal
s registered with the Scheduler. |
List<TriggerListener> |
getInternalTriggerListeners()
Get a list containing all of the
s in the Scheduler's internal list. |
JobDetail |
getJobDetail(String jobKey)
Get the
for the Job instance with the given name and group. |
JobFactory |
getJobFactory() |
Set<String> |
getJobKeys()
Get the names of all the
in the matching groups. |
Class |
getJobStoreClass() |
ListenerManager |
getListenerManager()
|
SchedulerSignaler |
getSchedulerSignaler() |
ThreadGroup |
getSchedulerThreadGroup()
Returns the name of the thread group for Quartz's main threads.
|
Class |
getThreadPoolClass() |
int |
getThreadPoolSize() |
Trigger |
getTrigger(String triggerKey)
Get the
instance with the given name and group. |
List<Trigger> |
getTriggersOfJob(String jobKey)
|
void |
initialize() |
boolean |
isInStandbyMode()
Reports whether the
Scheduler is paused. |
boolean |
isShutdown()
Reports whether the
Scheduler has been shutdown. |
boolean |
isShuttingDown() |
boolean |
isSignalOnSchedulingChange() |
boolean |
isStarted()
Whether the scheduler has been started.
|
void |
notifyJobListenersToBeExecuted(JobExecutionContext jec) |
void |
notifyJobListenersWasExecuted(JobExecutionContext jec,
JobExecutionException je) |
void |
notifyJobListenersWasVetoed(JobExecutionContext jec) |
void |
notifyJobStoreJobComplete(OperableTrigger trigger,
JobDetail detail,
Trigger.CompletedExecutionInstruction instCode) |
void |
notifyJobStoreJobVetoed(OperableTrigger trigger,
JobDetail detail,
Trigger.CompletedExecutionInstruction instCode) |
void |
notifySchedulerListenersError(String msg,
SchedulerException se) |
void |
notifySchedulerListenersFinalized(Trigger trigger) |
void |
notifySchedulerListenersJobDeleted(String jobKey) |
void |
notifyTriggerListenersComplete(JobExecutionContext jec,
Trigger.CompletedExecutionInstruction instCode) |
boolean |
notifyTriggerListenersFired(JobExecutionContext jec) |
void |
notifyTriggerListenersMisfired(Trigger trigger) |
boolean |
removeInternalSchedulerListener(SchedulerListener schedulerListener)
Remove the given
from the Scheduler's list of internal listeners. |
Date |
rescheduleJob(String triggerName,
OperableTrigger newTrigger)
Remove (delete) the
with the given key, and store the new given one - which must be
associated with the same job (the new trigger must have the job name specified) - however, the new trigger need not have the same name as the old
trigger. |
Date |
scheduleJob(JobDetail jobDetail,
OperableTrigger trigger)
|
Date |
scheduleJob(OperableTrigger trigger)
|
void |
setJobFactory(JobFactory factory)
Set the
JobFactory that will be responsible for producing
instances of Job classes. |
void |
setSignalOnSchedulingChange(boolean signalOnSchedulingChange) |
void |
shutdown(boolean waitForJobsToComplete)
Halts the
QuartzScheduler's firing of , and cleans up all resources associated with
the QuartzScheduler. |
void |
standby()
Temporarily halts the
QuartzScheduler's firing of . |
void |
start()
Starts the
QuartzScheduler's threads that fire . |
void |
startDelayed(int seconds)
Calls {#start()} after the indicated number of seconds.
|
void |
triggerJob(String jobKey,
JobDataMap data)
Trigger the identified
(execute it now) - with a non-volatile trigger. |
void |
unscheduleJob(String triggerKey)
Remove the indicated
from the scheduler. |
public QuartzScheduler(QuartzSchedulerResources quartzSchedulerResources) throws SchedulerException
Create a QuartzScheduler with the given configuration properties.
SchedulerExceptionQuartzSchedulerResourcespublic void initialize()
throws SchedulerException
SchedulerExceptionpublic SchedulerSignaler getSchedulerSignaler()
public ThreadGroup getSchedulerThreadGroup()
Returns the name of the thread group for Quartz's main threads.
public boolean isSignalOnSchedulingChange()
public void setSignalOnSchedulingChange(boolean signalOnSchedulingChange)
public void start()
throws SchedulerException
Starts the QuartzScheduler's threads that fire .
Triggers
All that have misfired will be passed to the appropriate TriggerListener(s).
Triggers
start in interface SchedulerSchedulerException - if shutdown() has been called, or there is an error within the Scheduler.public void startDelayed(int seconds)
throws SchedulerException
SchedulerstartDelayed in interface SchedulerSchedulerException - if shutdown() has been called, or there is an error within the Scheduler.public void standby()
Temporarily halts the QuartzScheduler's firing of .
Triggers
The scheduler is not destroyed, and can be re-started at any time.
public boolean isInStandbyMode()
Reports whether the Scheduler is paused.
isInStandbyMode in interface Schedulerpublic Class getJobStoreClass()
public Class getThreadPoolClass()
public int getThreadPoolSize()
public void shutdown(boolean waitForJobsToComplete)
Halts the QuartzScheduler's firing of , and cleans up all resources associated with
the QuartzScheduler.
Triggers
The scheduler cannot be re-started.
public boolean isShutdown()
Reports whether the Scheduler has been shutdown.
isShutdown in interface Schedulerpublic boolean isShuttingDown()
public boolean isStarted()
Scheduler
Note: This only reflects whether has ever been called on this Scheduler, so it will return Scheduler.start()true even
if the Scheduler is currently in standby mode or has been since shutdown.
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.
getCurrentlyExecutingJobs in interface Schedulerpublic Date scheduleJob(JobDetail jobDetail, OperableTrigger trigger) throws SchedulerException
Add the identified by the given Job to the Scheduler, and
associate the given JobDetail with it.
Trigger
If the given Trigger does not reference any Job, then it will be set to reference the Job passed with it into this method.
scheduleJob in interface SchedulerSchedulerException - if the Job or Trigger cannot be added to the Scheduler, or there is an internal Scheduler error.public Date scheduleJob(OperableTrigger trigger) throws SchedulerException
Schedule the given with the TriggerJob identified by the Trigger's settings.
scheduleJob in interface SchedulerSchedulerException - if the indicated Job does not exist, or the Trigger cannot be added to the Scheduler, or there is an internal
Scheduler error.public void addJob(JobDetail jobDetail) 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.
addJob in interface SchedulerSchedulerException - 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.public void deleteJob(String jobKey) throws SchedulerException
SchedulerJob from the Scheduler - and any associated Triggers.deleteJob in interface SchedulerSchedulerException - if there is an internal Scheduler error.public void unscheduleJob(String triggerKey) throws SchedulerException
SchedulerTrigger from the scheduler.
If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.
unscheduleJob in interface SchedulerSchedulerExceptionpublic Date rescheduleJob(String triggerName, OperableTrigger newTrigger) throws SchedulerException
SchedulerOperableTrigger with the given key, and store the new given one - which must be
associated with the same job (the new trigger must have the job name specified) - however, the new trigger need not have the same name as the old
trigger.rescheduleJob in interface SchedulertriggerName - identity of the trigger to replacenewTrigger - The new Trigger to be stored.null if a Trigger with the given name & group was not found and removed from the store, otherwise the first
fire time of the newly scheduled trigger.SchedulerExceptionpublic void triggerJob(String jobKey, JobDataMap data) throws SchedulerException
Trigger the identified (execute it now) - with a non-volatile trigger.
Job
triggerJob in interface Schedulerdata - the (possibly null) JobDataMap to be associated with the trigger that fires the job immediately.SchedulerExceptionpublic List<Trigger> getTriggersOfJob(String jobKey) throws SchedulerException
getTriggersOfJob in interface SchedulerSchedulerExceptionpublic JobDetail getJobDetail(String jobKey) throws SchedulerException
Get the for the JobDetailJob instance with the given name and group.
getJobDetail in interface SchedulerSchedulerExceptionpublic Trigger getTrigger(String triggerKey) throws SchedulerException
Get the instance with the given name and group.
Trigger
getTrigger in interface SchedulerSchedulerExceptionpublic ListenerManager getListenerManager()
getListenerManager in interface SchedulerListenerManagerSchedulerExceptionpublic List<JobListener> getInternalJobListeners()
Get a List containing all of the s in the JobListenerScheduler's internal list.
public List<TriggerListener> getInternalTriggerListeners()
Get a list containing all of the s in the TriggerListenerScheduler's internal list.
public void addInternalSchedulerListener(SchedulerListener schedulerListener)
Register the given with the SchedulerListenerScheduler's list of internal listeners.
public boolean removeInternalSchedulerListener(SchedulerListener schedulerListener)
Remove the given from the SchedulerListenerScheduler's list of internal listeners.
public List<SchedulerListener> getInternalSchedulerListeners()
Get a List containing all of the internal s registered with the SchedulerListenerScheduler.
public void notifyJobStoreJobComplete(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode) throws JobPersistenceException
JobPersistenceExceptionpublic void notifyJobStoreJobVetoed(OperableTrigger trigger, JobDetail detail, Trigger.CompletedExecutionInstruction instCode) throws JobPersistenceException
JobPersistenceExceptionpublic boolean notifyTriggerListenersFired(JobExecutionContext jec) throws SchedulerException
SchedulerExceptionpublic void notifyTriggerListenersMisfired(Trigger trigger) throws SchedulerException
SchedulerExceptionpublic void notifyTriggerListenersComplete(JobExecutionContext jec, Trigger.CompletedExecutionInstruction instCode) throws SchedulerException
SchedulerExceptionpublic void notifyJobListenersToBeExecuted(JobExecutionContext jec) throws SchedulerException
SchedulerExceptionpublic void notifyJobListenersWasVetoed(JobExecutionContext jec) throws SchedulerException
SchedulerExceptionpublic void notifyJobListenersWasExecuted(JobExecutionContext jec, JobExecutionException je) throws SchedulerException
SchedulerExceptionpublic void notifySchedulerListenersError(String msg, SchedulerException se)
public void notifySchedulerListenersFinalized(Trigger trigger)
public void notifySchedulerListenersJobDeleted(String jobKey)
public void setJobFactory(JobFactory factory) throws SchedulerException
SchedulerJobFactory that will be responsible for producing
instances of Job classes.
JobFactories may be of use to those wishing to have their application
produce Job instances via some special mechanism, such as to
give the opportunity for dependency injection.
setJobFactory in interface SchedulerSchedulerExceptionorg.quartz.spi.JobFactorypublic JobFactory getJobFactory()
public CascadingClassLoadHelper getCascadingClassLoadHelper()
getCascadingClassLoadHelper in interface Schedulerpublic Set<String> getJobKeys() throws SchedulerException
Get the names of all the in the matching groups.
Jobs
getJobKeys in interface SchedulerSchedulerException - On errorCopyright © 2011–2017 Knowm Inc.. All rights reserved.