org.terracotta.quartz
Class PlainTerracottaJobStore<T extends ClusteredJobStore>

java.lang.Object
  extended by org.terracotta.quartz.PlainTerracottaJobStore<T>
All Implemented Interfaces:
JobListener, JobStore, TerracottaJobStoreExtensions

public class PlainTerracottaJobStore<T extends ClusteredJobStore>
extends Object
implements TerracottaJobStoreExtensions


Field Summary
protected  ToolkitInternal toolkit
           
 
Constructor Summary
PlainTerracottaJobStore(ToolkitInternal toolkit)
           
 
Method Summary
 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.
 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 clearAllSchedulingData()
          Clear (delete!) all scheduling data - all Jobs, Triggers Calendars.
protected  T createNewJobStoreInstance(String schedulerName, boolean useSynchWrite)
           
 List<String> getCalendarNames()
          Get the names of all of the Calendar s in the JobStore.
protected  T getClusteredJobStore()
           
 long getEstimatedTimeToReleaseAndAcquireTrigger()
          How long (in milliseconds) the JobStore implementation estimates that it will take to release a trigger and acquire a new one.
 List<String> getJobGroupNames()
          Get the names of all of the Job groups.
 Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
          Get the keys of all of the Job s that have the given group name.
 String getName()
           Get the name of the JobListener.
 int getNumberOfCalendars()
          Get the number of Calendar s that are stored in the JobsStore.
 int getNumberOfJobs()
          Get the number of Job s that are stored in the JobsStore.
 int getNumberOfTriggers()
          Get the number of Trigger s that are stored in the JobsStore.
 Set<String> getPausedTriggerGroups()
           
 List<String> getTriggerGroupNames()
          Get the names of all of the Trigger groups.
 Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
          Get the names of all of the Trigger s that have the given group name.
 List<OperableTrigger> getTriggersForJob(JobKey jobKey)
          Get all of the Triggers that are associated to the given Job.
 Trigger.TriggerState getTriggerState(TriggerKey triggerKey)
          Get the current state of the identified Trigger.
 String getUUID()
           
 void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)
          Called by the QuartzScheduler before the JobStore is used, in order to give the it a chance to initialize.
 boolean isClustered()
          Whether or not the JobStore implementation is clustered.
 void jobExecutionVetoed(JobExecutionContext context)
           Called by the Scheduler when a JobDetail was about to be executed (an associated Trigger has occurred), but a TriggerListener vetoed it's execution.
 void jobToBeExecuted(JobExecutionContext context)
           Called by the Scheduler when a JobDetail is about to be executed (an associated Trigger has occurred).
 void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
           Called by the Scheduler after a JobDetail has been executed, and be for the associated Trigger's triggered(xx) method has been called.
 void pauseAll()
          Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group.
 void pauseJob(JobKey jobKey)
          Pause the Job with the given name - by pausing all of its current Triggers.
 Collection<String> pauseJobs(GroupMatcher<JobKey> matcher)
          Pause all of the Jobs in the given group - by pausing all of their Triggers.
 void pauseTrigger(TriggerKey triggerKey)
          Pause the Trigger with the given key.
 Collection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher)
          Pause all of the Triggers in the given group.
 void releaseAcquiredTrigger(OperableTrigger trigger)
          Inform the JobStore that the scheduler no longer plans to fire the given Trigger, that it had previously acquired (reserved).
 boolean removeCalendar(String calName)
          Remove (delete) the Calendar with the given name.
 boolean removeJob(JobKey jobKey)
          Remove (delete) the Job with the given key, and any Trigger s that reference it.
 boolean removeJobs(List<JobKey> jobKeys)
           
 boolean removeTrigger(TriggerKey triggerKey)
          Remove (delete) the Trigger with the given key.
 boolean removeTriggers(List<TriggerKey> triggerKeys)
           
 boolean replaceTrigger(TriggerKey triggerKey, OperableTrigger newTrigger)
          Remove (delete) the Trigger with the given key, 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 Job with the given key.
 Collection<String> resumeJobs(GroupMatcher<JobKey> matcher)
          Resume (un-pause) all of the Jobs in the given group.
 void resumeTrigger(TriggerKey triggerKey)
          Resume (un-pause) the Trigger with the given key.
 Collection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher)
          Resume (un-pause) all of the Triggers in the given group.
 Calendar retrieveCalendar(String calName)
          Retrieve the given Trigger.
 JobDetail retrieveJob(JobKey jobKey)
          Retrieve the JobDetail for the given Job.
 OperableTrigger retrieveTrigger(TriggerKey triggerKey)
          Retrieve the given Trigger.
 void schedulerPaused()
          Called by the QuartzScheduler to inform the JobStore that the scheduler has been paused.
 void schedulerResumed()
          Called by the QuartzScheduler to inform the JobStore that the scheduler has resumed after being paused.
 void schedulerStarted()
          Called by the QuartzScheduler to inform the JobStore that the scheduler has started.
 void setEstimatedTimeToReleaseAndAcquireTrigger(long estimate)
           
 void setInstanceId(String schedInstId)
          Inform the JobStore of the Scheduler instance's Id, prior to initialize being invoked.
 void setInstanceName(String schedName)
          Inform the JobStore of the Scheduler instance's name, prior to initialize being invoked.
 void setMisfireThreshold(long threshold)
           
 void setSynchronousWrite(String synchWrite)
           
 void setTcRetryInterval(long retryInterval)
           
 void setThreadPoolSize(int size)
          Tells the JobStore the pool size used to execute jobs
 void shutdown()
          Called by the QuartzScheduler to inform the JobStore that it should free up all of it's resources because the scheduler is shutting down.
 void storeCalendar(String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers)
          Store the given Calendar.
 void storeJob(JobDetail newJob, boolean replaceExisting)
          Store the given JobDetail.
 void storeJobAndTrigger(JobDetail newJob, OperableTrigger newTrigger)
          Store the given JobDetail and Trigger.
 void storeJobsAndTriggers(Map<JobDetail,Set<? extends Trigger>> triggersAndJobs, boolean replace)
           
 void storeTrigger(OperableTrigger newTrigger, boolean replaceExisting)
          Store the given Trigger.
 boolean supportsPersistence()
           
 String toString()
           
 void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode)
          Inform the JobStore that the scheduler has completed the firing of the given Trigger (and the execution of its associated Job completed, threw an exception, or was vetoed), and that the JobDataMap in the given JobDetail should be updated if the Job is stateful.
 List<TriggerFiredResult> triggersFired(List<OperableTrigger> triggers)
          Inform the JobStore that the scheduler is now firing the given Trigger (executing its associated Job), that it had previously acquired (reserved).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toolkit

protected final ToolkitInternal toolkit
Constructor Detail

PlainTerracottaJobStore

public PlainTerracottaJobStore(ToolkitInternal toolkit)
Method Detail

setSynchronousWrite

public void setSynchronousWrite(String synchWrite)
Specified by:
setSynchronousWrite in interface TerracottaJobStoreExtensions

setThreadPoolSize

public void setThreadPoolSize(int size)
Description copied from interface: JobStore
Tells the JobStore the pool size used to execute jobs

Specified by:
setThreadPoolSize in interface JobStore
Specified by:
setThreadPoolSize in interface TerracottaJobStoreExtensions
Parameters:
size - amount of threads allocated for job execution

acquireNextTriggers

public List<OperableTrigger> acquireNextTriggers(long noLaterThan,
                                                 int maxCount,
                                                 long timeWindow)
                                          throws JobPersistenceException
Description copied from interface: JobStore
Get a handle to the next trigger to be fired, and mark it as 'reserved' by the calling scheduler.

Specified by:
acquireNextTriggers in interface JobStore
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.
Throws:
JobPersistenceException
See Also:
#releaseAcquiredTrigger(Trigger)

getCalendarNames

public List<String> getCalendarNames()
                              throws JobPersistenceException
Description copied from interface: JobStore
Get the names of all of the Calendar s in the JobStore.

If there are no Calendars in the given group name, the result should be a zero-length array (not null).

Specified by:
getCalendarNames in interface JobStore
Throws:
JobPersistenceException

getJobGroupNames

public List<String> getJobGroupNames()
                              throws JobPersistenceException
Description copied from interface: JobStore
Get the names of all of the Job groups.

If there are no known group names, the result should be a zero-length array (not null).

Specified by:
getJobGroupNames in interface JobStore
Throws:
JobPersistenceException

getJobKeys

public Set<JobKey> getJobKeys(GroupMatcher<JobKey> matcher)
                       throws JobPersistenceException
Description copied from interface: JobStore
Get the keys of all of the Job s that have the given group name.

If there are no jobs in the given group name, the result should be an empty collection (not null).

Specified by:
getJobKeys in interface JobStore
Throws:
JobPersistenceException

getNumberOfCalendars

public int getNumberOfCalendars()
                         throws JobPersistenceException
Description copied from interface: JobStore
Get the number of Calendar s that are stored in the JobsStore.

Specified by:
getNumberOfCalendars in interface JobStore
Throws:
JobPersistenceException

getNumberOfJobs

public int getNumberOfJobs()
                    throws JobPersistenceException
Description copied from interface: JobStore
Get the number of Job s that are stored in the JobsStore.

Specified by:
getNumberOfJobs in interface JobStore
Throws:
JobPersistenceException

getNumberOfTriggers

public int getNumberOfTriggers()
                        throws JobPersistenceException
Description copied from interface: JobStore
Get the number of Trigger s that are stored in the JobsStore.

Specified by:
getNumberOfTriggers in interface JobStore
Throws:
JobPersistenceException

getPausedTriggerGroups

public Set<String> getPausedTriggerGroups()
                                   throws JobPersistenceException
Specified by:
getPausedTriggerGroups in interface JobStore
Throws:
JobPersistenceException

getTriggerGroupNames

public List<String> getTriggerGroupNames()
                                  throws JobPersistenceException
Description copied from interface: JobStore
Get the names of all of the Trigger groups.

If there are no known group names, the result should be a zero-length array (not null).

Specified by:
getTriggerGroupNames in interface JobStore
Throws:
JobPersistenceException

getTriggerKeys

public Set<TriggerKey> getTriggerKeys(GroupMatcher<TriggerKey> matcher)
                               throws JobPersistenceException
Description copied from interface: JobStore
Get the names of all of the Trigger s that have the given group name.

If there are no triggers in the given group name, the result should be a zero-length array (not null).

Specified by:
getTriggerKeys in interface JobStore
Throws:
JobPersistenceException

getTriggersForJob

public List<OperableTrigger> getTriggersForJob(JobKey jobKey)
                                        throws JobPersistenceException
Description copied from interface: JobStore
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:
getTriggersForJob in interface JobStore
Throws:
JobPersistenceException

getTriggerState

public Trigger.TriggerState getTriggerState(TriggerKey triggerKey)
                                     throws JobPersistenceException
Description copied from interface: JobStore
Get the current state of the identified Trigger.

Specified by:
getTriggerState in interface JobStore
Throws:
JobPersistenceException
See Also:
Trigger.TriggerState

initialize

public void initialize(ClassLoadHelper loadHelper,
                       SchedulerSignaler signaler)
                throws SchedulerConfigException
Description copied from interface: JobStore
Called by the QuartzScheduler before the JobStore is used, in order to give the it a chance to initialize.

Specified by:
initialize in interface JobStore
Throws:
SchedulerConfigException

pauseAll

public void pauseAll()
              throws JobPersistenceException
Description copied from interface: JobStore
Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group.

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

Specified by:
pauseAll in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.resumeAll(), #pauseTriggers(String)

pauseJob

public void pauseJob(JobKey jobKey)
              throws JobPersistenceException
Description copied from interface: JobStore
Pause the Job with the given name - by pausing all of its current Triggers.

Specified by:
pauseJob in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.resumeJob(JobKey)

pauseJobs

public Collection<String> pauseJobs(GroupMatcher<JobKey> matcher)
                             throws JobPersistenceException
Description copied from interface: JobStore
Pause all of the Jobs in the given group - by pausing all of their Triggers.

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:
pauseJobs in interface JobStore
Throws:
JobPersistenceException
See Also:
#resumeJobGroup(String)

pauseTrigger

public void pauseTrigger(TriggerKey triggerKey)
                  throws JobPersistenceException
Description copied from interface: JobStore
Pause the Trigger with the given key.

Specified by:
pauseTrigger in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.resumeTrigger(TriggerKey)

pauseTriggers

public Collection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher)
                                 throws JobPersistenceException
Description copied from interface: JobStore
Pause all of the Triggers in the given group.

The JobStore should "remember" that the group is paused, and impose the pause on any new triggers that are added to the group while the group is paused.

Specified by:
pauseTriggers in interface JobStore
Throws:
JobPersistenceException
See Also:
#resumeTriggerGroup(String)

releaseAcquiredTrigger

public void releaseAcquiredTrigger(OperableTrigger trigger)
Description copied from interface: JobStore
Inform the JobStore that the scheduler no longer plans to fire the given Trigger, that it had previously acquired (reserved).

Specified by:
releaseAcquiredTrigger in interface JobStore

triggersFired

public List<TriggerFiredResult> triggersFired(List<OperableTrigger> triggers)
                                       throws JobPersistenceException
Description copied from interface: JobStore
Inform the JobStore that the scheduler is now firing the given Trigger (executing its associated Job), that it had previously acquired (reserved).

Specified by:
triggersFired in interface JobStore
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.
Throws:
JobPersistenceException

removeCalendar

public boolean removeCalendar(String calName)
                       throws JobPersistenceException
Description copied from interface: JobStore
Remove (delete) the Calendar with the given name.

If removal of the Calendar would result in Triggers pointing to non-existent calendars, then a JobPersistenceException will be thrown.

*

Specified by:
removeCalendar in interface JobStore
Parameters:
calName - The name of the Calendar to be removed.
Returns:
true if a Calendar with the given name was found and removed from the store.
Throws:
JobPersistenceException

removeJob

public boolean removeJob(JobKey jobKey)
                  throws JobPersistenceException
Description copied from interface: JobStore
Remove (delete) the Job with the given key, and any Trigger s that reference it.

If removal of the Job results in an empty group, the group should be removed from the JobStore's list of known group names.

Specified by:
removeJob in interface JobStore
Returns:
true if a Job with the given name & group was found and removed from the store.
Throws:
JobPersistenceException

removeTrigger

public boolean removeTrigger(TriggerKey triggerKey)
                      throws JobPersistenceException
Description copied from interface: JobStore
Remove (delete) the Trigger with the given key.

If removal of the Trigger results in an empty group, the group should be removed from the JobStore's list of known group names.

If removal of the Trigger results in an 'orphaned' Job that is not 'durable', then the Job should be deleted also.

Specified by:
removeTrigger in interface JobStore
Returns:
true if a Trigger with the given name & group was found and removed from the store.
Throws:
JobPersistenceException

removeJobs

public boolean removeJobs(List<JobKey> jobKeys)
                   throws JobPersistenceException
Specified by:
removeJobs in interface JobStore
Throws:
JobPersistenceException

removeTriggers

public boolean removeTriggers(List<TriggerKey> triggerKeys)
                       throws JobPersistenceException
Specified by:
removeTriggers in interface JobStore
Throws:
JobPersistenceException

storeJobsAndTriggers

public void storeJobsAndTriggers(Map<JobDetail,Set<? extends Trigger>> triggersAndJobs,
                                 boolean replace)
                          throws JobPersistenceException
Specified by:
storeJobsAndTriggers in interface JobStore
Throws:
JobPersistenceException

replaceTrigger

public boolean replaceTrigger(TriggerKey triggerKey,
                              OperableTrigger newTrigger)
                       throws JobPersistenceException
Description copied from interface: JobStore
Remove (delete) the Trigger with the given key, and store the new given one - which must be associated with the same job.

Specified by:
replaceTrigger in interface JobStore
newTrigger - The new Trigger to be stored.
Returns:
true if a Trigger with the given name & group was found and removed from the store.
Throws:
JobPersistenceException

resumeAll

public void resumeAll()
               throws JobPersistenceException
Description copied from interface: JobStore
Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) on every group.

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

Specified by:
resumeAll in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.pauseAll()

resumeJob

public void resumeJob(JobKey jobKey)
               throws JobPersistenceException
Description copied from interface: JobStore
Resume (un-pause) the Job with the given key.

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

Specified by:
resumeJob in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.pauseJob(JobKey)

resumeJobs

public Collection<String> resumeJobs(GroupMatcher<JobKey> matcher)
                              throws JobPersistenceException
Description copied from interface: JobStore
Resume (un-pause) all of the Jobs in the given group.

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

Specified by:
resumeJobs in interface JobStore
Throws:
JobPersistenceException
See Also:
#pauseJobGroup(String)

resumeTrigger

public void resumeTrigger(TriggerKey triggerKey)
                   throws JobPersistenceException
Description copied from interface: JobStore
Resume (un-pause) the Trigger with the given key.

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

Specified by:
resumeTrigger in interface JobStore
Throws:
JobPersistenceException
See Also:
JobStore.pauseTrigger(TriggerKey)

resumeTriggers

public Collection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher)
                                  throws JobPersistenceException
Description copied from interface: JobStore
Resume (un-pause) all of the Triggers in the given group.

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

Specified by:
resumeTriggers in interface JobStore
Throws:
JobPersistenceException
See Also:
#pauseTriggers(String)

retrieveCalendar

public Calendar retrieveCalendar(String calName)
                          throws JobPersistenceException
Description copied from interface: JobStore
Retrieve the given Trigger.

Specified by:
retrieveCalendar in interface JobStore
Parameters:
calName - The name of the Calendar to be retrieved.
Returns:
The desired Calendar, or null if there is no match.
Throws:
JobPersistenceException

retrieveJob

public JobDetail retrieveJob(JobKey jobKey)
                      throws JobPersistenceException
Description copied from interface: JobStore
Retrieve the JobDetail for the given Job.

Specified by:
retrieveJob in interface JobStore
Returns:
The desired Job, or null if there is no match.
Throws:
JobPersistenceException

retrieveTrigger

public OperableTrigger retrieveTrigger(TriggerKey triggerKey)
                                throws JobPersistenceException
Description copied from interface: JobStore
Retrieve the given Trigger.

Specified by:
retrieveTrigger in interface JobStore
Returns:
The desired Trigger, or null if there is no match.
Throws:
JobPersistenceException

checkExists

public boolean checkExists(JobKey jobKey)
                    throws JobPersistenceException
Description copied from interface: JobStore
Determine whether a Job with the given identifier already exists within the scheduler.

Specified by:
checkExists in interface JobStore
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
Description copied from interface: JobStore
Determine whether a Trigger with the given identifier already exists within the scheduler.

Specified by:
checkExists in interface JobStore
Parameters:
triggerKey - the identifier to check for
Returns:
true if a Trigger exists with the given identifier
Throws:
JobPersistenceException

clearAllSchedulingData

public void clearAllSchedulingData()
                            throws JobPersistenceException
Description copied from interface: JobStore
Clear (delete!) all scheduling data - all Jobs, Triggers Calendars.

Specified by:
clearAllSchedulingData in interface JobStore
Throws:
JobPersistenceException

schedulerStarted

public void schedulerStarted()
                      throws SchedulerException
Description copied from interface: JobStore
Called by the QuartzScheduler to inform the JobStore that the scheduler has started.

Specified by:
schedulerStarted in interface JobStore
Throws:
SchedulerException

schedulerPaused

public void schedulerPaused()
Description copied from interface: JobStore
Called by the QuartzScheduler to inform the JobStore that the scheduler has been paused.

Specified by:
schedulerPaused in interface JobStore

schedulerResumed

public void schedulerResumed()
Description copied from interface: JobStore
Called by the QuartzScheduler to inform the JobStore that the scheduler has resumed after being paused.

Specified by:
schedulerResumed in interface JobStore

shutdown

public void shutdown()
Description copied from interface: JobStore
Called by the QuartzScheduler to inform the JobStore that it should free up all of it's resources because the scheduler is shutting down.

Specified by:
shutdown in interface JobStore

storeCalendar

public void storeCalendar(String name,
                          Calendar calendar,
                          boolean replaceExisting,
                          boolean updateTriggers)
                   throws JobPersistenceException
Description copied from interface: JobStore
Store the given Calendar.

Specified by:
storeCalendar in interface JobStore
calendar - The Calendar to be stored.
replaceExisting - If true, any Calendar existing in the JobStore with the same name & group should be over-written.
updateTriggers - If true, any Triggers existing in the JobStore that reference an existing Calendar with the same name with have their next fire time re-computed with the new Calendar.
Throws:
ObjectAlreadyExistsException - if a Calendar with the same name already exists, and replaceExisting is set to false.
JobPersistenceException

storeJob

public void storeJob(JobDetail newJob,
                     boolean replaceExisting)
              throws JobPersistenceException
Description copied from interface: JobStore
Store the given JobDetail.

Specified by:
storeJob in interface JobStore
Parameters:
newJob - The JobDetail to be stored.
replaceExisting - If true, any Job existing in the JobStore with the same name & group should be over-written.
Throws:
ObjectAlreadyExistsException - if a Job with the same name/group already exists, and replaceExisting is set to false.
JobPersistenceException

storeJobAndTrigger

public void storeJobAndTrigger(JobDetail newJob,
                               OperableTrigger newTrigger)
                        throws JobPersistenceException
Description copied from interface: JobStore
Store the given JobDetail and Trigger.

Specified by:
storeJobAndTrigger in interface JobStore
Parameters:
newJob - The JobDetail to be stored.
newTrigger - The Trigger to be stored.
Throws:
ObjectAlreadyExistsException - if a Job with the same name/group already exists.
JobPersistenceException

storeTrigger

public void storeTrigger(OperableTrigger newTrigger,
                         boolean replaceExisting)
                  throws JobPersistenceException
Description copied from interface: JobStore
Store the given Trigger.

Specified by:
storeTrigger in interface JobStore
Parameters:
newTrigger - The Trigger to be stored.
replaceExisting - If true, any Trigger existing in the JobStore with the same name & group should be over-written.
Throws:
ObjectAlreadyExistsException - if a Trigger with the same name/group already exists, and replaceExisting is set to false.
JobPersistenceException
See Also:
JobStore.pauseTriggers(org.quartz.impl.matchers.GroupMatcher)

supportsPersistence

public boolean supportsPersistence()
Specified by:
supportsPersistence in interface JobStore

toString

public String toString()
Overrides:
toString in class Object

triggeredJobComplete

public void triggeredJobComplete(OperableTrigger trigger,
                                 JobDetail jobDetail,
                                 Trigger.CompletedExecutionInstruction triggerInstCode)
Description copied from interface: JobStore
Inform the JobStore that the scheduler has completed the firing of the given Trigger (and the execution of its associated Job completed, threw an exception, or was vetoed), and that the JobDataMap in the given JobDetail should be updated if the Job is stateful.

Specified by:
triggeredJobComplete in interface JobStore

setMisfireThreshold

public void setMisfireThreshold(long threshold)
Specified by:
setMisfireThreshold in interface TerracottaJobStoreExtensions

setEstimatedTimeToReleaseAndAcquireTrigger

public void setEstimatedTimeToReleaseAndAcquireTrigger(long estimate)
Specified by:
setEstimatedTimeToReleaseAndAcquireTrigger in interface TerracottaJobStoreExtensions

setInstanceId

public void setInstanceId(String schedInstId)
Description copied from interface: JobStore
Inform the JobStore of the Scheduler instance's Id, prior to initialize being invoked.

Specified by:
setInstanceId in interface JobStore

setInstanceName

public void setInstanceName(String schedName)
Description copied from interface: JobStore
Inform the JobStore of the Scheduler instance's name, prior to initialize being invoked.

Specified by:
setInstanceName in interface JobStore

setTcRetryInterval

public void setTcRetryInterval(long retryInterval)
Specified by:
setTcRetryInterval in interface TerracottaJobStoreExtensions

getUUID

public String getUUID()
Specified by:
getUUID in interface TerracottaJobStoreExtensions

createNewJobStoreInstance

protected T createNewJobStoreInstance(String schedulerName,
                                      boolean useSynchWrite)

getEstimatedTimeToReleaseAndAcquireTrigger

public long getEstimatedTimeToReleaseAndAcquireTrigger()
Description copied from interface: JobStore
How long (in milliseconds) the JobStore implementation estimates that it will take to release a trigger and acquire a new one.

Specified by:
getEstimatedTimeToReleaseAndAcquireTrigger in interface JobStore

isClustered

public boolean isClustered()
Description copied from interface: JobStore
Whether or not the JobStore implementation is clustered.

Specified by:
isClustered in interface JobStore

getClusteredJobStore

protected T getClusteredJobStore()

getName

public String getName()
Description copied from interface: JobListener

Get the name of the JobListener.

Specified by:
getName in interface JobListener

jobToBeExecuted

public void jobToBeExecuted(JobExecutionContext context)
Description copied from interface: JobListener

Called by the Scheduler when a JobDetail is about to be executed (an associated Trigger has occurred).

This method will not be invoked if the execution of the Job was vetoed by a TriggerListener.

Specified by:
jobToBeExecuted in interface JobListener
See Also:
JobListener.jobExecutionVetoed(JobExecutionContext)

jobExecutionVetoed

public void jobExecutionVetoed(JobExecutionContext context)
Description copied from interface: JobListener

Called by the Scheduler when a JobDetail was about to be executed (an associated Trigger has occurred), but a TriggerListener vetoed it's execution.

Specified by:
jobExecutionVetoed in interface JobListener
See Also:
JobListener.jobToBeExecuted(JobExecutionContext)

jobWasExecuted

public void jobWasExecuted(JobExecutionContext context,
                           JobExecutionException jobException)
Description copied from interface: JobListener

Called by the Scheduler after a JobDetail has been executed, and be for the associated Trigger's triggered(xx) method has been called.

Specified by:
jobWasExecuted in interface JobListener


Copyright 2001-2019, Terracotta, Inc.