|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
org.quartz.core Class QuartzScheduler
java.lang.Objectorg.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
QuartzSchedulerwith 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:
getVersionin interfaceRemotableQuartzScheduler
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:
getSchedulerNamein interfaceRemotableQuartzScheduler
getSchedulerInstanceId
public String getSchedulerInstanceId()
Returns the instance Id of the
QuartzScheduler.- Specified by:
getSchedulerInstanceIdin interfaceRemotableQuartzScheduler
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
SchedulerContextof theScheduler.- Specified by:
getSchedulerContextin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
isSignalOnSchedulingChange
public boolean isSignalOnSchedulingChange()
setSignalOnSchedulingChange
public void setSignalOnSchedulingChange(boolean signalOnSchedulingChange)
start
public void start()
throws SchedulerException
Starts the
QuartzScheduler's threads that fireTriggers.All
Triggers that have misfired will be passed to the appropriate TriggerListener(s).- 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 ofTriggers.The 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 Date runningSince()
- Specified by:
runningSincein interfaceRemotableQuartzScheduler
numJobsExecuted
public int numJobsExecuted()
- Specified by:
numJobsExecutedin interfaceRemotableQuartzScheduler
getJobStoreClass
public Class getJobStoreClass()
- Specified by:
getJobStoreClassin interfaceRemotableQuartzScheduler
supportsPersistence
public boolean supportsPersistence()
- Specified by:
supportsPersistencein interfaceRemotableQuartzScheduler
isClustered
public boolean isClustered()
- Specified by:
isClusteredin interfaceRemotableQuartzScheduler
getThreadPoolClass
public Class getThreadPoolClass()
- Specified by:
getThreadPoolClassin interfaceRemotableQuartzScheduler
getThreadPoolSize
public int getThreadPoolSize()
- Specified by:
getThreadPoolSizein interfaceRemotableQuartzScheduler
shutdown
public void shutdown()
Halts the
QuartzScheduler's firing ofTriggers, and cleans up all resources associated with the QuartzScheduler. Equivalent toshutdown(false).The scheduler cannot be re-started.
- Specified by:
shutdownin interfaceRemotableQuartzScheduler
shutdown
public void shutdown(boolean waitForJobsToComplete)
Halts the
QuartzScheduler's firing ofTriggers, and cleans up all resources associated with the QuartzScheduler.The 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 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 Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException
Add the
Jobidentified by the givenJobDetailto the Scheduler, and associate the givenTriggerwith 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:
scheduleJobin interfaceRemotableQuartzScheduler
- 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
Triggerwith theJobidentified 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.
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(List<JobKey> jobKeys) throws SchedulerException
- Specified by:
deleteJobsin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
scheduleJobs
public void scheduleJobs(Map<JobDetail,List<Trigger>> triggersAndJobs, boolean replace) throws SchedulerException
- Specified by:
scheduleJobsin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
unscheduleJobs
public boolean unscheduleJobs(List<TriggerKey> triggerKeys) throws SchedulerException
- Specified by:
unscheduleJobsin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
unscheduleJob
public boolean unscheduleJob(TriggerKey triggerKey) throws SchedulerException
Remove the indicated
Triggerfrom the scheduler.- Specified by:
unscheduleJobin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
rescheduleJob
public Date rescheduleJob(TriggerKey triggerKey, Trigger newTrigger) throws SchedulerException
Remove (delete) the
Triggerwith the given name, and store the new given one - which must be associated with the same job.- Specified by:
rescheduleJobin interfaceRemotableQuartzScheduler
- Parameters:
newTrigger- The newTriggerto be stored.- Returns:
nullif aTriggerwith 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:
triggerJobin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
triggerJob
public void triggerJob(org.quartz.spi.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
Triggerwith the given name.- Specified by:
pauseTriggerin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
pauseTriggers
public void pauseTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException
Pause all of the
Triggers in the matching groups.- Specified by:
pauseTriggersin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
pauseJob
public void pauseJob(JobKey jobKey) throws SchedulerException
Pause the
JobDetailwith the given name - by pausing all of its currentTriggers.- Specified by:
pauseJobin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
pauseJobs
public void pauseJobs(GroupMatcher<JobKey> groupMatcher) throws SchedulerException
Pause all of the
JobDetails in the matching groups - by pausing all of theirTriggers.- Specified by:
pauseJobsin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
resumeTrigger
public void resumeTrigger(TriggerKey triggerKey) throws SchedulerException
Resume (un-pause) the
Triggerwith the given name.If 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
Triggers in the matching groups.If any
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeTriggersin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getPausedTriggerGroups
public Set getPausedTriggerGroups() throws SchedulerException
- Specified by:
getPausedTriggerGroupsin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
resumeJob
public void resumeJob(JobKey jobKey) throws SchedulerException
Resume (un-pause) the
JobDetailwith the given name.If 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
JobDetails in the matching groups.If 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 SchedulerException
Pause all triggers - equivalent of calling
pauseTriggers(GroupMatcherwith a matcher matching all known groups.) When
resumeAll()is called (to un-pause), trigger misfire instructions WILL be applied.- Specified by:
pauseAllin interfaceRemotableQuartzScheduler
resumeAll
public void resumeAll()
throws SchedulerException
Resume (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 List<String> getJobGroupNames() throws SchedulerException
Get the names of all known
Jobgroups.- Specified by:
getJobGroupNamesin interfaceRemotableQuartzScheduler
- 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:
getJobKeysin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getTriggersOfJob
public List<? extends Trigger> getTriggersOfJob(JobKey jobKey) throws SchedulerException
Get all
Triggers that are associated with the identifiedJobDetail.- Specified by:
getTriggersOfJobin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getTriggerGroupNames
public List<String> getTriggerGroupNames() throws SchedulerException
Get the names of all known
Triggergroups.- Specified by:
getTriggerGroupNamesin interfaceRemotableQuartzScheduler
- 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:
getTriggerKeysin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getJobDetail
public JobDetail getJobDetail(JobKey jobKey) throws SchedulerException
Get the
JobDetailfor theJobinstance with the given name and group.- Specified by:
getJobDetailin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getTrigger
public Trigger getTrigger(TriggerKey triggerKey) throws SchedulerException
Get the
Triggerinstance with the given name and group.- Specified by:
getTriggerin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
checkExists
public boolean checkExists(JobKey jobKey) throws SchedulerException
- Determine whether a
Jobwith 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 a
Triggerwith 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
- Clears (deletes!) all scheduling data - all
Jobs,TriggersCalendars. - Specified by:
clearin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getTriggerState
public Trigger.TriggerState getTriggerState(TriggerKey triggerKey) throws SchedulerException
Get the current state of the identified
Trigger.- Specified by:
getTriggerStatein interfaceRemotableQuartzScheduler
- Throws:
SchedulerException- See Also:
Trigger.TriggerState
addCalendar
public void addCalendar(String calName, Calendar calendar, boolean replace, boolean updateTriggers) throws SchedulerException
Add (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(String calName) throws SchedulerException
Delete 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(String calName) throws SchedulerException
Get the
Calendarinstance with the given name.- Specified by:
getCalendarin interfaceRemotableQuartzScheduler
- Throws:
SchedulerException
getCalendarNames
public List<String> getCalendarNames() throws SchedulerException
Get 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
JobListenerto theScheduler's internal list.
removeInternalJobListener
public boolean removeInternalJobListener(String name)
Remove the identified
JobListenerfrom theScheduler'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 theScheduler's internal list.
getInternalJobListener
public JobListener getInternalJobListener(String name)
Get the internal
JobListenerthat has the given name.
addInternalTriggerListener
public void addInternalTriggerListener(TriggerListener triggerListener)
Add the given
TriggerListenerto theScheduler's internal list.
removeinternalTriggerListener
public boolean removeinternalTriggerListener(String name)
Remove the identified
TriggerListenerfrom theScheduler'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 theScheduler's internal list.
getInternalTriggerListener
public TriggerListener getInternalTriggerListener(String name)
Get the internal
TriggerListenerthat has the given name.
addInternalSchedulerListener
public void addInternalSchedulerListener(SchedulerListener schedulerListener)
Register the given
SchedulerListenerwith theScheduler's list of internal listeners.
removeInternalSchedulerListener
public boolean removeInternalSchedulerListener(SchedulerListener schedulerListener)
Remove the given
SchedulerListenerfrom theScheduler'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 theScheduler.
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:
interruptin interfaceRemotableQuartzScheduler
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2001-2011, Terracotta, Inc.
org.quartz.core.QuartzScheduler