Class RAMJobStore
- java.lang.Object
-
- org.quartz.simpl.RAMJobStore
-
- All Implemented Interfaces:
JobStore
public class RAMJobStore extends java.lang.Object implements JobStore
This class implements a
that utilizes RAM as its storage device.JobStoreAs you should know, the ramification of this is that access is extremely fast, but the data is completely volatile - therefore this
JobStoreshould not be used if true persistence between program shutdowns is required.- Author:
- James House, Sharada Jambula, Eric Mueller
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashSet<JobKey>blockedJobsprotected java.util.HashMap<java.lang.String,Calendar>calendarsByNameprotected java.util.HashMap<java.lang.String,java.util.HashMap<JobKey,org.quartz.simpl.JobWrapper>>jobsByGroupprotected java.util.HashMap<JobKey,org.quartz.simpl.JobWrapper>jobsByKeyprotected java.lang.Objectlockprotected longmisfireThresholdprotected java.util.HashSet<java.lang.String>pausedJobGroupsprotected java.util.HashSet<java.lang.String>pausedTriggerGroupsprotected SchedulerSignalersignalerprotected java.util.TreeSet<org.quartz.simpl.TriggerWrapper>timeTriggersprotected java.util.HashMap<java.lang.String,java.util.HashMap<TriggerKey,org.quartz.simpl.TriggerWrapper>>triggersByGroupprotected java.util.Map<JobKey,java.util.List<org.quartz.simpl.TriggerWrapper>>triggersByJobprotected java.util.HashMap<TriggerKey,org.quartz.simpl.TriggerWrapper>triggersByKey
-
Constructor Summary
Constructors Constructor Description RAMJobStore()Create a newRAMJobStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<OperableTrigger>acquireNextTriggers(long noLaterThan, int maxCount, long timeWindow)Get a handle to the next trigger to be fired, and mark it as 'reserved' by the calling scheduler.protected booleanapplyMisfire(org.quartz.simpl.TriggerWrapper tw)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.voidclearAllSchedulingData()longgetAcquireRetryDelay(int failureCount)Get the amount of time (in ms) to wait when accessing this job store repeatedly fails.java.util.List<java.lang.String>getCalendarNames()Get the names of all of thes in theCalendarJobStore.longgetEstimatedTimeToReleaseAndAcquireTrigger()How long (in milliseconds) theJobStoreimplementation estimates that it will take to release a trigger and acquire a new one.protected java.lang.StringgetFiredTriggerRecordId()java.util.List<java.lang.String>getJobGroupNames()Get the names of all of thegroups.Jobjava.util.Set<JobKey>getJobKeys(GroupMatcher<JobKey> matcher)Get the names of all of thes that match the given groupMatcher.Jobprotected org.slf4j.LoggergetLog()longgetMisfireThreshold()intgetNumberOfCalendars()Get the number ofs that are stored in theCalendarJobsStore.intgetNumberOfJobs()Get the number ofs that are stored in theJobDetailJobsStore.intgetNumberOfTriggers()Get the number ofs that are stored in theTriggerJobsStore.java.util.Set<java.lang.String>getPausedTriggerGroups()java.util.List<java.lang.String>getTriggerGroupNames()Get the names of all of thegroups.Triggerjava.util.Set<TriggerKey>getTriggerKeys(GroupMatcher<TriggerKey> matcher)Get the names of all of thes that match the given groupMatcher.Triggerjava.util.List<OperableTrigger>getTriggersForJob(JobKey jobKey)Get all of the Triggers that are associated to the given Job.Trigger.TriggerStategetTriggerState(TriggerKey triggerKey)Get the current state of the identified.Triggerprotected java.util.ArrayList<org.quartz.simpl.TriggerWrapper>getTriggerWrappersForCalendar(java.lang.String calName)protected java.util.ArrayList<org.quartz.simpl.TriggerWrapper>getTriggerWrappersForJob(JobKey jobKey)voidinitialize(ClassLoadHelper loadHelper, SchedulerSignaler schedSignaler)Called by the QuartzScheduler before theJobStoreis used, in order to give the it a chance to initialize.booleanisClustered()Whether or not theJobStoreimplementation is clustered.voidpauseAll()Pause all triggers - equivalent of callingpauseTriggerGroup(group)on every group.voidpauseJob(JobKey jobKey)Pause thewith the given name - by pausing all of its currentJobDetailTriggers.java.util.List<java.lang.String>pauseJobs(GroupMatcher<JobKey> matcher)Pause all of thein the given group - by pausing all of theirJobDetailsTriggers.voidpauseTrigger(TriggerKey triggerKey)Pause thewith the given name.Triggerjava.util.List<java.lang.String>pauseTriggers(GroupMatcher<TriggerKey> matcher)Pause all of the knownmatching.Triggersprotected java.lang.StringpeekTriggers()voidreleaseAcquiredTrigger(OperableTrigger trigger)Inform theJobStorethat the scheduler no longer plans to fire the givenTrigger, that it had previously acquired (reserved).booleanremoveCalendar(java.lang.String calName)Remove (delete) thewith the given name.CalendarbooleanremoveJob(JobKey jobKey)booleanremoveJobs(java.util.List<JobKey> jobKeys)booleanremoveTrigger(TriggerKey triggerKey)Remove (delete) thewith the given name.TriggerbooleanremoveTriggers(java.util.List<TriggerKey> triggerKeys)booleanreplaceTrigger(TriggerKey triggerKey, OperableTrigger newTrigger)Remove (delete) thewith the given key, and store the new given one - which must be associated with the same job.TriggervoidresetTriggerFromErrorState(TriggerKey triggerKey)Reset the current state of the identifiedfromTriggerTrigger.TriggerState.ERRORtoTrigger.TriggerState.NORMALorTrigger.TriggerState.PAUSEDas appropriate.voidresumeAll()Resume (un-pause) all triggers - equivalent of callingresumeTriggerGroup(group)on every group.voidresumeJob(JobKey jobKey)Resume (un-pause) thewith the given name.JobDetailjava.util.Collection<java.lang.String>resumeJobs(GroupMatcher<JobKey> matcher)Resume (un-pause) all of thein the given group.JobDetailsvoidresumeTrigger(TriggerKey triggerKey)Resume (un-pause) thewith the given key.Triggerjava.util.List<java.lang.String>resumeTriggers(GroupMatcher<TriggerKey> matcher)Resume (un-pause) all of thein the given group.TriggersCalendarretrieveCalendar(java.lang.String calName)Retrieve the given.TriggerJobDetailretrieveJob(JobKey jobKey)OperableTriggerretrieveTrigger(TriggerKey triggerKey)Retrieve the given.TriggervoidschedulerPaused()Called by the QuartzScheduler to inform theJobStorethat the scheduler has been paused.voidschedulerResumed()Called by the QuartzScheduler to inform theJobStorethat the scheduler has resumed after being paused.voidschedulerStarted()Called by the QuartzScheduler to inform theJobStorethat the scheduler has started.protected voidsetAllTriggersOfJobToState(JobKey jobKey, int state)voidsetInstanceId(java.lang.String schedInstId)Inform theJobStoreof the Scheduler instance's Id, prior to initialize being invoked.voidsetInstanceName(java.lang.String schedName)Inform theJobStoreof the Scheduler instance's name, prior to initialize being invoked.voidsetMisfireThreshold(long misfireThreshold)The number of milliseconds by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied.voidsetThreadPoolSize(int poolSize)Tells the JobStore the pool size used to execute jobsvoidshutdown()Called by the QuartzScheduler to inform theJobStorethat it should free up all of it's resources because the scheduler is shutting down.voidstoreCalendar(java.lang.String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers)Store the given.CalendarvoidstoreJob(JobDetail newJob, boolean replaceExisting)Store the given.JobvoidstoreJobAndTrigger(JobDetail newJob, OperableTrigger newTrigger)voidstoreJobsAndTriggers(java.util.Map<JobDetail,java.util.Set<? extends Trigger>> triggersAndJobs, boolean replace)voidstoreTrigger(OperableTrigger newTrigger, boolean replaceExisting)Store the given.TriggerbooleansupportsPersistence()voidtriggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode)Inform theJobStorethat the scheduler has completed the firing of the givenTrigger(and the execution its associatedJob), and that thein the givenJobDataMapJobDetailshould be updated if theJobis stateful.java.util.List<TriggerFiredResult>triggersFired(java.util.List<OperableTrigger> firedTriggers)Inform theJobStorethat the scheduler is now firing the givenTrigger(executing its associatedJob), that it had previously acquired (reserved).
-
-
-
Field Detail
-
jobsByKey
protected final java.util.HashMap<JobKey,org.quartz.simpl.JobWrapper> jobsByKey
-
triggersByKey
protected final java.util.HashMap<TriggerKey,org.quartz.simpl.TriggerWrapper> triggersByKey
-
jobsByGroup
protected final java.util.HashMap<java.lang.String,java.util.HashMap<JobKey,org.quartz.simpl.JobWrapper>> jobsByGroup
-
triggersByGroup
protected final java.util.HashMap<java.lang.String,java.util.HashMap<TriggerKey,org.quartz.simpl.TriggerWrapper>> triggersByGroup
-
timeTriggers
protected final java.util.TreeSet<org.quartz.simpl.TriggerWrapper> timeTriggers
-
calendarsByName
protected final java.util.HashMap<java.lang.String,Calendar> calendarsByName
-
triggersByJob
protected final java.util.Map<JobKey,java.util.List<org.quartz.simpl.TriggerWrapper>> triggersByJob
-
lock
protected final java.lang.Object lock
-
pausedTriggerGroups
protected final java.util.HashSet<java.lang.String> pausedTriggerGroups
-
pausedJobGroups
protected final java.util.HashSet<java.lang.String> pausedJobGroups
-
blockedJobs
protected final java.util.HashSet<JobKey> blockedJobs
-
misfireThreshold
protected long misfireThreshold
-
signaler
protected SchedulerSignaler signaler
-
-
Method Detail
-
getLog
protected org.slf4j.Logger getLog()
-
initialize
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler schedSignaler)
Called by the QuartzScheduler before the
JobStoreis used, in order to give the it a chance to initialize.- Specified by:
initializein interfaceJobStore
-
schedulerStarted
public void schedulerStarted()
Description copied from interface:JobStoreCalled by the QuartzScheduler to inform theJobStorethat the scheduler has started.- Specified by:
schedulerStartedin interfaceJobStore
-
schedulerPaused
public void schedulerPaused()
Description copied from interface:JobStoreCalled by the QuartzScheduler to inform theJobStorethat the scheduler has been paused.- Specified by:
schedulerPausedin interfaceJobStore
-
schedulerResumed
public void schedulerResumed()
Description copied from interface:JobStoreCalled by the QuartzScheduler to inform theJobStorethat the scheduler has resumed after being paused.- Specified by:
schedulerResumedin interfaceJobStore
-
getMisfireThreshold
public long getMisfireThreshold()
-
setMisfireThreshold
public void setMisfireThreshold(long misfireThreshold)
The number of milliseconds by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied.- Parameters:
misfireThreshold- the new misfire threshold
-
shutdown
public void shutdown()
Called by the QuartzScheduler to inform the
JobStorethat it should free up all of it's resources because the scheduler is shutting down.
-
supportsPersistence
public boolean supportsPersistence()
- Specified by:
supportsPersistencein interfaceJobStore
-
clearAllSchedulingData
public void clearAllSchedulingData() throws JobPersistenceException- Specified by:
clearAllSchedulingDatain interfaceJobStore- Throws:
JobPersistenceException
-
storeJobAndTrigger
public void storeJobAndTrigger(JobDetail newJob, OperableTrigger newTrigger) throws JobPersistenceException
- Specified by:
storeJobAndTriggerin interfaceJobStore- Parameters:
newJob- TheJobDetailto be stored.newTrigger- TheTriggerto be stored.- Throws:
ObjectAlreadyExistsException- if aJobwith the same name/group already exists.ObjectAlreadyExistsException- if aJobwith the same name/group already exists.JobPersistenceException
-
storeJob
public void storeJob(JobDetail newJob, boolean replaceExisting) throws ObjectAlreadyExistsException
Store the given
.Job- Specified by:
storeJobin interfaceJobStore- Parameters:
newJob- TheJobto be stored.replaceExisting- Iftrue, anyJobexisting in theJobStorewith the same name and group should be over-written.- Throws:
ObjectAlreadyExistsException- if aJobwith the same name/group already exists, and replaceExisting is set to false.
-
removeJob
public boolean removeJob(JobKey jobKey)
-
removeJobs
public boolean removeJobs(java.util.List<JobKey> jobKeys) throws JobPersistenceException
- Specified by:
removeJobsin interfaceJobStore- Throws:
JobPersistenceException
-
removeTriggers
public boolean removeTriggers(java.util.List<TriggerKey> triggerKeys) throws JobPersistenceException
- Specified by:
removeTriggersin interfaceJobStore- Throws:
JobPersistenceException
-
storeJobsAndTriggers
public void storeJobsAndTriggers(java.util.Map<JobDetail,java.util.Set<? extends Trigger>> triggersAndJobs, boolean replace) throws JobPersistenceException
- Specified by:
storeJobsAndTriggersin interfaceJobStore- Throws:
JobPersistenceException
-
storeTrigger
public void storeTrigger(OperableTrigger newTrigger, boolean replaceExisting) throws JobPersistenceException
Store the given
.Trigger- Specified by:
storeTriggerin interfaceJobStore- Parameters:
newTrigger- TheTriggerto be stored.replaceExisting- Iftrue, anyTriggerexisting in theJobStorewith the same name and group should be over-written.- Throws:
ObjectAlreadyExistsException- if aTriggerwith the same name/group already exists, and replaceExisting is set to false.ObjectAlreadyExistsException- if aTriggerwith the same name/group already exists, and replaceExisting is set to false.JobPersistenceException- See Also:
pauseTriggers(org.quartz.impl.matchers.GroupMatcher)
-
removeTrigger
public boolean removeTrigger(TriggerKey triggerKey)
Remove (delete) the
with the given name.Trigger- Specified by:
removeTriggerin interfaceJobStore- Returns:
trueif aTriggerwith the given name and group was found and removed from the store.
-
replaceTrigger
public boolean replaceTrigger(TriggerKey triggerKey, OperableTrigger newTrigger) throws JobPersistenceException
Description copied from interface:JobStoreRemove (delete) thewith the given key, and store the new given one - which must be associated with the same job.Trigger- Specified by:
replaceTriggerin interfaceJobStorenewTrigger- The newTriggerto be stored.- Returns:
trueif aTriggerwith the given name and group was found and removed from the store.- Throws:
JobPersistenceException- See Also:
JobStore.replaceTrigger(TriggerKey triggerKey, OperableTrigger newTrigger)
-
retrieveJob
public JobDetail retrieveJob(JobKey jobKey)
- Specified by:
retrieveJobin interfaceJobStore- Returns:
- The desired
Job, or null if there is no match.
-
retrieveTrigger
public OperableTrigger retrieveTrigger(TriggerKey triggerKey)
Retrieve the given
.Trigger- Specified by:
retrieveTriggerin interfaceJobStore- Returns:
- The desired
Trigger, or null if there is no match.
-
checkExists
public boolean checkExists(JobKey jobKey) throws JobPersistenceException
Determine whether aJobwith the given identifier already exists within the scheduler.- Specified by:
checkExistsin interfaceJobStore- Parameters:
jobKey- the identifier to check for- Returns:
- true if a Job exists with the given identifier
- Throws:
JobPersistenceException
-
checkExists
public boolean checkExists(TriggerKey triggerKey) throws JobPersistenceException
Determine whether aTriggerwith the given identifier already exists within the scheduler.- Specified by:
checkExistsin interfaceJobStore- Parameters:
triggerKey- the identifier to check for- Returns:
- true if a Trigger exists with the given identifier
- Throws:
JobPersistenceException
-
getTriggerState
public Trigger.TriggerState getTriggerState(TriggerKey triggerKey) throws JobPersistenceException
Get the current state of the identified
.Trigger- Specified by:
getTriggerStatein interfaceJobStore- Throws:
JobPersistenceException- See Also:
Trigger.TriggerState.NORMAL,Trigger.TriggerState.PAUSED,Trigger.TriggerState.COMPLETE,Trigger.TriggerState.ERROR,Trigger.TriggerState.BLOCKED,Trigger.TriggerState.NONE
-
resetTriggerFromErrorState
public void resetTriggerFromErrorState(TriggerKey triggerKey) throws JobPersistenceException
Reset the current state of the identifiedfromTriggerTrigger.TriggerState.ERRORtoTrigger.TriggerState.NORMALorTrigger.TriggerState.PAUSEDas appropriate.Only affects triggers that are in ERROR state - if identified trigger is not in that state then the result is a no-op.
The result will be the trigger returning to the normal, waiting to be fired state, unless the trigger's group has been paused, in which case it will go into the PAUSED state.
- Specified by:
resetTriggerFromErrorStatein interfaceJobStore- Throws:
JobPersistenceException
-
storeCalendar
public void storeCalendar(java.lang.String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers) throws ObjectAlreadyExistsExceptionStore the given
.Calendar- Specified by:
storeCalendarin interfaceJobStore- Parameters:
calendar- TheCalendarto be stored.replaceExisting- Iftrue, anyCalendarexisting in theJobStorewith the same name and group should be over-written.updateTriggers- Iftrue, anyTriggers existing in theJobStorethat reference an existing Calendar with the same name with have their next fire time re-computed with the newCalendar.- Throws:
ObjectAlreadyExistsException- if aCalendarwith the same name already exists, and replaceExisting is set to false.
-
removeCalendar
public boolean removeCalendar(java.lang.String calName) throws JobPersistenceExceptionRemove (delete) the
with the given name.CalendarIf removal of the
*Calendarwould result inTriggers pointing to nonexistent calendars, then aJobPersistenceExceptionwill be thrown.- Specified by:
removeCalendarin interfaceJobStore- Parameters:
calName- The name of theCalendarto be removed.- Returns:
trueif aCalendarwith the given name was found and removed from the store.- Throws:
JobPersistenceException
-
retrieveCalendar
public Calendar retrieveCalendar(java.lang.String calName)
Retrieve the given
.Trigger- Specified by:
retrieveCalendarin interfaceJobStore- Parameters:
calName- The name of theCalendarto be retrieved.- Returns:
- The desired
Calendar, or null if there is no match.
-
getNumberOfJobs
public int getNumberOfJobs()
Get the number of
s that are stored in theJobDetailJobsStore.- Specified by:
getNumberOfJobsin interfaceJobStore
-
getNumberOfTriggers
public int getNumberOfTriggers()
Get the number of
s that are stored in theTriggerJobsStore.- Specified by:
getNumberOfTriggersin interfaceJobStore
-
getNumberOfCalendars
public int getNumberOfCalendars()
Get the number of
s that are stored in theCalendarJobsStore.- Specified by:
getNumberOfCalendarsin interfaceJobStore
-
getJobKeys
public java.util.Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
Get the names of all of the
s that match the given groupMatcher.Job- Specified by:
getJobKeysin interfaceJobStore
-
getCalendarNames
public java.util.List<java.lang.String> getCalendarNames()
Get the names of all of the
s in theCalendarJobStore.If there are no Calendars in the given group name, the result should be a zero-length array (not
null).- Specified by:
getCalendarNamesin interfaceJobStore
-
getTriggerKeys
public java.util.Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
Get the names of all of the
s that match the given groupMatcher.Trigger- Specified by:
getTriggerKeysin interfaceJobStore
-
getJobGroupNames
public java.util.List<java.lang.String> getJobGroupNames()
Get the names of all of the
groups.Job- Specified by:
getJobGroupNamesin interfaceJobStore
-
getTriggerGroupNames
public java.util.List<java.lang.String> getTriggerGroupNames()
Get the names of all of the
groups.Trigger- Specified by:
getTriggerGroupNamesin interfaceJobStore
-
getTriggersForJob
public java.util.List<OperableTrigger> getTriggersForJob(JobKey jobKey)
Get all of the Triggers that are associated to the given Job.
If there are no matches, a zero-length array should be returned.
- Specified by:
getTriggersForJobin interfaceJobStore
-
getTriggerWrappersForJob
protected java.util.ArrayList<org.quartz.simpl.TriggerWrapper> getTriggerWrappersForJob(JobKey jobKey)
-
getTriggerWrappersForCalendar
protected java.util.ArrayList<org.quartz.simpl.TriggerWrapper> getTriggerWrappersForCalendar(java.lang.String calName)
-
pauseTrigger
public void pauseTrigger(TriggerKey triggerKey)
Pause the
with the given name.Trigger- Specified by:
pauseTriggerin interfaceJobStore- See Also:
JobStore.resumeTrigger(TriggerKey)
-
pauseTriggers
public java.util.List<java.lang.String> pauseTriggers(GroupMatcher<TriggerKey> matcher)
Pause all of the known
matching.TriggersThe JobStore should "remember" the groups paused, and impose the pause on any new triggers that are added to one of these groups while the group is paused.
- Specified by:
pauseTriggersin interfaceJobStore- See Also:
JobStore.resumeTriggers(GroupMatcher)
-
pauseJob
public void pauseJob(JobKey jobKey)
Pause the
with the given name - by pausing all of its currentJobDetailTriggers.- Specified by:
pauseJobin interfaceJobStore- See Also:
JobStore.resumeJob(JobKey)
-
pauseJobs
public java.util.List<java.lang.String> pauseJobs(GroupMatcher<JobKey> matcher)
Pause all of the
in the given group - by pausing all of theirJobDetailsTriggers.The JobStore should "remember" that the group is paused, and impose the pause on any new jobs that are added to the group while the group is paused.
- Specified by:
pauseJobsin interfaceJobStore- See Also:
JobStore.resumeJobs(GroupMatcher)
-
resumeTrigger
public void resumeTrigger(TriggerKey triggerKey)
Resume (un-pause) the
with the given key.TriggerIf the
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeTriggerin interfaceJobStore- See Also:
JobStore.pauseTrigger(TriggerKey)
-
resumeTriggers
public java.util.List<java.lang.String> resumeTriggers(GroupMatcher<TriggerKey> matcher)
Resume (un-pause) all of the
in the given group.TriggersIf any
Triggermissed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeTriggersin interfaceJobStore- See Also:
JobStore.pauseTriggers(GroupMatcher)
-
resumeJob
public void resumeJob(JobKey jobKey)
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 interfaceJobStore- See Also:
JobStore.pauseJob(JobKey)
-
resumeJobs
public java.util.Collection<java.lang.String> resumeJobs(GroupMatcher<JobKey> matcher)
Resume (un-pause) all of the
in the given group.JobDetailsIf any of the
Jobs hadTriggers that missed one or more fire-times, then theTrigger's misfire instruction will be applied.- Specified by:
resumeJobsin interfaceJobStore- See Also:
JobStore.pauseJobs(GroupMatcher)
-
pauseAll
public void pauseAll()
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:
pauseAllin interfaceJobStore- See Also:
resumeAll(),pauseTrigger(org.quartz.TriggerKey),pauseTriggers(org.quartz.impl.matchers.GroupMatcher)
-
resumeAll
public void resumeAll()
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 interfaceJobStore- See Also:
pauseAll()
-
applyMisfire
protected boolean applyMisfire(org.quartz.simpl.TriggerWrapper tw)
-
getFiredTriggerRecordId
protected java.lang.String getFiredTriggerRecordId()
-
acquireNextTriggers
public java.util.List<OperableTrigger> acquireNextTriggers(long noLaterThan, int maxCount, long timeWindow)
Get a handle to the next trigger to be fired, and mark it as 'reserved' by the calling scheduler.
- Specified by:
acquireNextTriggersin interfaceJobStore- Parameters:
noLaterThan- If > 0, the JobStore should only return a Trigger that will fire no later than the time represented in this value as milliseconds.- See Also:
releaseAcquiredTrigger(OperableTrigger)
-
releaseAcquiredTrigger
public void releaseAcquiredTrigger(OperableTrigger trigger)
Inform the
JobStorethat the scheduler no longer plans to fire the givenTrigger, that it had previously acquired (reserved).- Specified by:
releaseAcquiredTriggerin interfaceJobStore
-
triggersFired
public java.util.List<TriggerFiredResult> triggersFired(java.util.List<OperableTrigger> firedTriggers)
Inform the
JobStorethat the scheduler is now firing the givenTrigger(executing its associatedJob), that it had previously acquired (reserved).- Specified by:
triggersFiredin interfaceJobStore- Returns:
- may return null if all the triggers or their calendars no longer exist, or if the trigger was not successfully put into the 'executing' state. Preference is to return an empty list if none of the triggers could be fired.
-
triggeredJobComplete
public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode)
Inform the
JobStorethat the scheduler has completed the firing of the givenTrigger(and the execution its associatedJob), and that thein the givenJobDataMapJobDetailshould be updated if theJobis stateful.- Specified by:
triggeredJobCompletein interfaceJobStore
-
getAcquireRetryDelay
public long getAcquireRetryDelay(int failureCount)
Description copied from interface:JobStoreGet the amount of time (in ms) to wait when accessing this job store repeatedly fails. Called by the executor thread(s) when calls toJobStore.acquireNextTriggers(long, int, long)fail more than once in succession, and the thread thus wants to wait a bit before trying again, to not consume 100% CPU, write huge amounts of errors into logs, etc. in cases like the DB being offline/restarting. The delay returned by implementations should be between 20 and 600000 milliseconds.- Specified by:
getAcquireRetryDelayin interfaceJobStore- Parameters:
failureCount- the number of successive failures seen so far- Returns:
- the time (in milliseconds) to wait before trying again
-
setAllTriggersOfJobToState
protected void setAllTriggersOfJobToState(JobKey jobKey, int state)
-
peekTriggers
protected java.lang.String peekTriggers()
-
getPausedTriggerGroups
public java.util.Set<java.lang.String> getPausedTriggerGroups() throws JobPersistenceException- Specified by:
getPausedTriggerGroupsin interfaceJobStore- Throws:
JobPersistenceException- See Also:
JobStore.getPausedTriggerGroups()
-
setInstanceId
public void setInstanceId(java.lang.String schedInstId)
Description copied from interface:JobStoreInform theJobStoreof the Scheduler instance's Id, prior to initialize being invoked.- Specified by:
setInstanceIdin interfaceJobStore
-
setInstanceName
public void setInstanceName(java.lang.String schedName)
Description copied from interface:JobStoreInform theJobStoreof the Scheduler instance's name, prior to initialize being invoked.- Specified by:
setInstanceNamein interfaceJobStore
-
setThreadPoolSize
public void setThreadPoolSize(int poolSize)
Description copied from interface:JobStoreTells the JobStore the pool size used to execute jobs- Specified by:
setThreadPoolSizein interfaceJobStore- Parameters:
poolSize- amount of threads allocated for job execution
-
getEstimatedTimeToReleaseAndAcquireTrigger
public long getEstimatedTimeToReleaseAndAcquireTrigger()
Description copied from interface:JobStoreHow long (in milliseconds) theJobStoreimplementation estimates that it will take to release a trigger and acquire a new one.- Specified by:
getEstimatedTimeToReleaseAndAcquireTriggerin interfaceJobStore
-
isClustered
public boolean isClustered()
Description copied from interface:JobStoreWhether or not theJobStoreimplementation is clustered.- Specified by:
isClusteredin interfaceJobStore
-
-