public abstract class JobStoreSupport extends java.lang.Object implements JobStore, Constants
Contains base functionality for JDBC-based JobStore implementations.
ALIAS_COL_NEXT_FIRE_TIME, ALL_GROUPS_PAUSED, COL_BLOB, COL_CALENDAR, COL_CALENDAR_NAME, COL_CHECKIN_INTERVAL, COL_CRON_EXPRESSION, COL_DESCRIPTION, COL_END_TIME, COL_ENTRY_ID, COL_ENTRY_STATE, COL_FIRED_TIME, COL_INSTANCE_NAME, COL_IS_DURABLE, COL_IS_STATEFUL, COL_IS_VOLATILE, COL_JOB_CLASS, COL_JOB_DATAMAP, COL_JOB_GROUP, COL_JOB_LISTENER, COL_JOB_NAME, COL_LAST_CHECKIN_TIME, COL_LOCK_NAME, COL_MISFIRE_INSTRUCTION, COL_NEXT_FIRE_TIME, COL_PREV_FIRE_TIME, COL_PRIORITY, COL_REPEAT_COUNT, COL_REPEAT_INTERVAL, COL_REQUESTS_RECOVERY, COL_START_TIME, COL_TIME_ZONE_ID, COL_TIMES_TRIGGERED, COL_TRIGGER_GROUP, COL_TRIGGER_LISTENER, COL_TRIGGER_NAME, COL_TRIGGER_STATE, COL_TRIGGER_TYPE, DEFAULT_TABLE_PREFIX, STATE_ACQUIRED, STATE_BLOCKED, STATE_COMPLETE, STATE_DELETED, STATE_ERROR, STATE_EXECUTING, STATE_MISFIRED, STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_WAITING, TABLE_BLOB_TRIGGERS, TABLE_CALENDARS, TABLE_CRON_TRIGGERS, TABLE_FIRED_TRIGGERS, TABLE_JOB_DETAILS, TABLE_JOB_LISTENERS, TABLE_LOCKS, TABLE_PAUSED_TRIGGERS, TABLE_SCHEDULER_STATE, TABLE_SIMPLE_TRIGGERS, TABLE_TRIGGER_LISTENERS, TABLE_TRIGGERS, TTYPE_BLOB, TTYPE_CRON, TTYPE_SIMPLE
Constructor and Description |
---|
JobStoreSupport() |
Modifier and Type | Method and Description |
---|---|
Trigger |
acquireNextTrigger(SchedulingContext ctxt,
long noLaterThan)
Get a handle to the next N triggers to be fired, and mark them as 'reserved'
by the calling scheduler.
|
boolean |
canUseProperties()
Get whether String-only properties will be handled in JobDataMaps.
|
java.lang.Object |
executeWithoutLock(org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionCallback txCallback)
Execute the given callback in a transaction.
|
java.lang.String[] |
getCalendarNames(SchedulingContext ctxt)
Get the names of all of the
s
in the JobStore . |
long |
getClusterCheckinInterval()
Get the frequency (in milliseconds) at which this instance "checks-in"
with the other instances of the cluster. -- Affects the rate of
detecting failed instances.
|
java.lang.String |
getDataSource()
Get the name of the
DataSource that should be used for
performing database functions. |
long |
getDbRetryInterval() |
boolean |
getDoubleCheckLockMisfireHandler()
Get whether to check to see if there are Triggers that have misfired
before actually acquiring the lock to recover them.
|
java.lang.String |
getDriverDelegateClass()
Get the JDBC driver delegate class name.
|
java.lang.String |
getInstanceId()
Get the instance Id of the Scheduler (must be unique within a cluster).
|
java.lang.String |
getInstanceName()
Get the instance name of the Scheduler (must be unique within this server instance).
|
java.lang.String[] |
getJobGroupNames(SchedulingContext ctxt)
Get the names of all of the
groups. |
java.lang.String[] |
getJobNames(SchedulingContext ctxt,
java.lang.String groupName)
Get the names of all of the
s that
have the given group name. |
boolean |
getMakeThreadsDaemons()
Get whether the threads spawned by this JobStore should be
marked as daemon.
|
int |
getMaxMisfiresToHandleAtATime()
Get the maximum number of misfired triggers that the misfire handling
thread will try to recover at one time (within one transaction).
|
long |
getMisfireThreshold() |
int |
getNumberOfCalendars(SchedulingContext ctxt)
Get the number of
s that are
stored in the JobsStore . |
int |
getNumberOfJobs(SchedulingContext ctxt)
Get the number of
s that are
stored in the JobStore . |
int |
getNumberOfTriggers(SchedulingContext ctxt)
Get the number of
s that are
stored in the JobsStore . |
java.util.Set |
getPausedTriggerGroups(java.sql.Connection conn,
SchedulingContext ctxt)
Pause all of the
in the
given group. |
java.util.Set |
getPausedTriggerGroups(SchedulingContext ctxt) |
java.lang.String |
getSelectWithLockSQL() |
java.lang.String |
getTablePrefix()
Get the prefix that should be pre-pended to all table names.
|
java.lang.String[] |
getTriggerGroupNames(SchedulingContext ctxt)
Get the names of all of the
groups. |
java.lang.String[] |
getTriggerNames(SchedulingContext ctxt,
java.lang.String groupName)
Get the names of all of the
s
that have the given group name. |
Trigger[] |
getTriggersForJob(SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
Get all of the Triggers that are associated to the given Job.
|
int |
getTriggerState(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName) |
int |
getTriggerState(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Get the current state of the identified
. |
boolean |
getUseDBLocks()
Get whether this instance should use database-based thread
synchronization.
|
void |
initialize(ClassLoadHelper loadHelper,
SchedulerSignaler signaler)
Called by the QuartzScheduler before the
JobStore is
used, in order to give it a chance to initialize. |
boolean |
isAcquireTriggersWithinLock()
Whether or not the query and update to acquire a Trigger for firing
should be performed after obtaining an explicit DB lock (to avoid
possible race conditions on the trigger's db row).
|
boolean |
isClustered()
Get whether this instance is part of a cluster.
|
boolean |
isDontSetAutoCommitFalse() |
boolean |
isLockOnInsert() |
boolean |
isThreadsInheritInitializersClassLoadContext()
Get whether to set the class load context of spawned threads to that
of the initializing thread.
|
boolean |
isTxIsolationLevelSerializable() |
void |
pauseAll(java.sql.Connection conn,
SchedulingContext ctxt)
Pause all triggers - equivalent of calling
pauseTriggerGroup(group)
on every group. |
void |
pauseAll(SchedulingContext ctxt)
Pause all triggers - equivalent of calling
pauseTriggerGroup(group)
on every group. |
void |
pauseJob(SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
Pause the
with the given name - by
pausing all of its current Trigger s. |
void |
pauseJobGroup(SchedulingContext ctxt,
java.lang.String groupName)
Pause all of the
in the given
group - by pausing all of their Trigger s. |
void |
pauseTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Pause the
with the given name. |
void |
pauseTrigger(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Pause the
with the given name. |
void |
pauseTriggerGroup(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String groupName)
Pause all of the
in the
given group. |
void |
pauseTriggerGroup(SchedulingContext ctxt,
java.lang.String groupName)
Pause all of the
in the
given group. |
void |
releaseAcquiredTrigger(SchedulingContext ctxt,
Trigger trigger)
Inform the
JobStore that the scheduler no longer plans to
fire the given Trigger , that it had previously acquired
(reserved). |
boolean |
removeCalendar(SchedulingContext ctxt,
java.lang.String calName)
Remove (delete) the
with the
given name. |
boolean |
removeJob(SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
|
boolean |
removeTrigger(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Remove (delete) the
with the
given name. |
boolean |
replaceTrigger(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName,
Trigger newTrigger)
Remove (delete) the
with the
given name, and store the new given one - which must be associated
with the same job. |
void |
resumeAll(java.sql.Connection conn,
SchedulingContext ctxt)
protected
Resume (un-pause) all triggers - equivalent of calling
resumeTriggerGroup(group)
on every group. |
void |
resumeAll(SchedulingContext ctxt)
Resume (un-pause) all triggers - equivalent of calling
resumeTriggerGroup(group)
on every group. |
void |
resumeJob(SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
Resume (un-pause) the
with the
given name. |
void |
resumeJobGroup(SchedulingContext ctxt,
java.lang.String groupName)
Resume (un-pause) all of the
in
the given group. |
void |
resumeTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Resume (un-pause) the
with the
given name. |
void |
resumeTrigger(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Resume (un-pause) the
with the
given name. |
void |
resumeTriggerGroup(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String groupName)
Resume (un-pause) all of the
in the given group. |
void |
resumeTriggerGroup(SchedulingContext ctxt,
java.lang.String groupName)
Resume (un-pause) all of the
in the given group. |
Calendar |
retrieveCalendar(SchedulingContext ctxt,
java.lang.String calName)
Retrieve the given
. |
JobDetail |
retrieveJob(SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
|
Trigger |
retrieveTrigger(SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
Retrieve the given
. |
void |
schedulerStarted()
Called by the QuartzScheduler to inform the
JobStore that
the scheduler has started. |
void |
setAcquireTriggersWithinLock(boolean acquireTriggersWithinLock)
Whether or not the query and update to acquire a Trigger for firing
should be performed after obtaining an explicit DB lock.
|
void |
setClusterCheckinInterval(long l)
Set the frequency (in milliseconds) at which this instance "checks-in"
with the other instances of the cluster. -- Affects the rate of
detecting failed instances.
|
void |
setDataSource(java.lang.String dsName)
Set the name of the
DataSource that should be used for
performing database functions. |
void |
setDbRetryInterval(long dbRetryInterval) |
void |
setDontSetAutoCommitFalse(boolean b)
Don't call set autocommit(false) on connections obtained from the
DataSource.
|
void |
setDoubleCheckLockMisfireHandler(boolean doubleCheckLockMisfireHandler)
Set whether to check to see if there are Triggers that have misfired
before actually acquiring the lock to recover them.
|
void |
setDriverDelegateClass(java.lang.String delegateClassName)
Set the JDBC driver delegate class.
|
void |
setInstanceId(java.lang.String instanceId)
Set the instance Id of the Scheduler (must be unique within a cluster).
|
void |
setInstanceName(java.lang.String instanceName)
Set the instance name of the Scheduler (must be unique within this server instance).
|
void |
setIsClustered(boolean isClustered)
Set whether this instance is part of a cluster.
|
void |
setLockHandler(Semaphore lockHandler) |
void |
setLockOnInsert(boolean lockOnInsert)
Whether or not to obtain locks when inserting new jobs/triggers.
|
void |
setMakeThreadsDaemons(boolean makeThreadsDaemons)
Set whether the threads spawned by this JobStore should be
marked as daemon.
|
void |
setMaxMisfiresToHandleAtATime(int maxToRecoverAtATime)
Set the maximum number of misfired triggers that the misfire handling
thread will try to recover at one time (within one transaction).
|
void |
setMisfireThreshold(long misfireThreshold)
The 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.
|
void |
setSelectWithLockSQL(java.lang.String string)
set the SQL statement to use to select and lock a row in the "locks"
table.
|
void |
setTablePrefix(java.lang.String prefix)
Set the prefix that should be pre-pended to all table names.
|
void |
setThreadsInheritInitializersClassLoadContext(boolean threadsInheritInitializersClassLoadContext)
Set whether to set the class load context of spawned threads to that
of the initializing thread.
|
void |
setTxIsolationLevelSerializable(boolean b)
Set the transaction isolation level of DB connections to sequential.
|
void |
setUseDBLocks(boolean useDBLocks)
Set whether this instance should use database-based thread
synchronization.
|
void |
setUseProperties(java.lang.String useProp)
Set whether String-only properties will be handled in JobDataMaps.
|
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(SchedulingContext ctxt,
java.lang.String calName,
Calendar calendar,
boolean replaceExisting,
boolean updateTriggers)
Store the given
. |
void |
storeJob(SchedulingContext ctxt,
JobDetail newJob,
boolean replaceExisting)
Store the given
. |
void |
storeJobAndTrigger(SchedulingContext ctxt,
JobDetail newJob,
Trigger newTrigger)
|
void |
storeTrigger(SchedulingContext ctxt,
Trigger newTrigger,
boolean replaceExisting)
Store the given
. |
boolean |
supportsPersistence() |
void |
triggeredJobComplete(SchedulingContext ctxt,
Trigger trigger,
JobDetail jobDetail,
int triggerInstCode)
Inform the
JobStore that the scheduler has completed the
firing of the given Trigger (and the execution its
associated Job ), and that the
in the given JobDetail should be updated if the Job
is stateful. |
TriggerFiredBundle |
triggerFired(SchedulingContext ctxt,
Trigger trigger)
Inform the
JobStore that the scheduler is now firing the
given Trigger (executing its associated Job ),
that it had previously acquired (reserved). |
public void setDataSource(java.lang.String dsName)
Set the name of the DataSource
that should be used for
performing database functions.
public java.lang.String getDataSource()
Get the name of the DataSource
that should be used for
performing database functions.
public void setTablePrefix(java.lang.String prefix)
Set the prefix that should be pre-pended to all table names.
public java.lang.String getTablePrefix()
Get the prefix that should be pre-pended to all table names.
public void setUseProperties(java.lang.String useProp)
Set whether String-only properties will be handled in JobDataMaps.
public boolean canUseProperties()
Get whether String-only properties will be handled in JobDataMaps.
public void setInstanceId(java.lang.String instanceId)
Set the instance Id of the Scheduler (must be unique within a cluster).
public java.lang.String getInstanceId()
Get the instance Id of the Scheduler (must be unique within a cluster).
public void setInstanceName(java.lang.String instanceName)
public java.lang.String getInstanceName()
public void setIsClustered(boolean isClustered)
Set whether this instance is part of a cluster.
public boolean isClustered()
Get whether this instance is part of a cluster.
public long getClusterCheckinInterval()
Get the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. -- Affects the rate of detecting failed instances.
public void setClusterCheckinInterval(long l)
Set the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. -- Affects the rate of detecting failed instances.
public int getMaxMisfiresToHandleAtATime()
Get the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction). The default is 20.
public void setMaxMisfiresToHandleAtATime(int maxToRecoverAtATime)
Set the maximum number of misfired triggers that the misfire handling thread will try to recover at one time (within one transaction). The default is 20.
public long getDbRetryInterval()
public void setDbRetryInterval(long dbRetryInterval)
dbRetryInterval
- The dbRetryInterval to set.public void setUseDBLocks(boolean useDBLocks)
Set whether this instance should use database-based thread synchronization.
public boolean getUseDBLocks()
Get whether this instance should use database-based thread synchronization.
public boolean isLockOnInsert()
public void setLockOnInsert(boolean lockOnInsert)
true
, which is safest - some db's (such as
MS SQLServer) seem to require this to avoid deadlocks under high load,
while others seem to do fine without.
Setting this property to false
will provide a
significant performance increase during the addition of new jobs
and triggers.
lockOnInsert
- public long getMisfireThreshold()
public void setMisfireThreshold(long misfireThreshold)
misfireThreshold
- public boolean isDontSetAutoCommitFalse()
public void setDontSetAutoCommitFalse(boolean b)
b
- public boolean isTxIsolationLevelSerializable()
public void setTxIsolationLevelSerializable(boolean b)
b
- public boolean isAcquireTriggersWithinLock()
public void setAcquireTriggersWithinLock(boolean acquireTriggersWithinLock)
public void setDriverDelegateClass(java.lang.String delegateClassName) throws InvalidConfigurationException
Set the JDBC driver delegate class.
delegateClassName
- the delegate class nameInvalidConfigurationException
public java.lang.String getDriverDelegateClass()
Get the JDBC driver delegate class name.
public java.lang.String getSelectWithLockSQL()
public void setSelectWithLockSQL(java.lang.String string)
set the SQL statement to use to select and lock a row in the "locks" table.
StdRowLockSemaphore
public boolean getMakeThreadsDaemons()
MisfireHandler
and the ClusterManager
.Thread.setDaemon(boolean)
public void setMakeThreadsDaemons(boolean makeThreadsDaemons)
MisfireHandler
and the ClusterManager
.Thread.setDaemon(boolean)
public boolean isThreadsInheritInitializersClassLoadContext()
public void setThreadsInheritInitializersClassLoadContext(boolean threadsInheritInitializersClassLoadContext)
public boolean getDoubleCheckLockMisfireHandler()
public void setDoubleCheckLockMisfireHandler(boolean doubleCheckLockMisfireHandler)
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException
Called by the QuartzScheduler before the JobStore
is
used, in order to give it a chance to initialize.
initialize
in interface JobStore
SchedulerConfigException
public void schedulerStarted() throws SchedulerException
JobStore
Called by the QuartzScheduler to inform the JobStore
that
the scheduler has started.
schedulerStarted
in interface JobStore
SchedulerException
JobStore.schedulerStarted()
public 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.
public boolean supportsPersistence()
supportsPersistence
in interface JobStore
public void storeJobAndTrigger(SchedulingContext ctxt, JobDetail newJob, Trigger newTrigger) throws ObjectAlreadyExistsException, JobPersistenceException
storeJobAndTrigger
in interface JobStore
newJob
- The JobDetail
to be stored.newTrigger
- The Trigger
to be stored.ObjectAlreadyExistsException
- if a Job
with the same name/group already
exists.JobPersistenceException
public void storeJob(SchedulingContext ctxt, JobDetail newJob, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
Store the given
.
JobDetail
storeJob
in interface JobStore
newJob
- The JobDetail
to be stored.replaceExisting
- If true
, any Job
existing in the
JobStore
with the same name & group should be
over-written.ObjectAlreadyExistsException
- if a Job
with the same name/group already
exists, and replaceExisting is set to false.JobPersistenceException
public void storeTrigger(SchedulingContext ctxt, Trigger newTrigger, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
Store the given
.
Trigger
storeTrigger
in interface JobStore
newTrigger
- The Trigger
to be stored.replaceExisting
- If true
, any Trigger
existing in
the JobStore
with the same name & group should
be over-written.ObjectAlreadyExistsException
- if a Trigger
with the same name/group already
exists, and replaceExisting is set to false.JobPersistenceException
JobStore.pauseTriggerGroup(SchedulingContext, String)
public boolean removeJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
Remove (delete) the
with the given
name, and any Job
s that reference
it.
Trigger
If removal of the Job
results in an empty group, the
group should be removed from the JobStore
's list of
known group names.
removeJob
in interface JobStore
jobName
- The name of the Job
to be removed.groupName
- The group name of the Job
to be removed.true
if a Job
with the given name &
group was found and removed from the store.JobPersistenceException
public JobDetail retrieveJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
retrieveJob
in interface JobStore
jobName
- The name of the Job
to be retrieved.groupName
- The group name of the Job
to be retrieved.Job
, or null if there is no match.JobPersistenceException
public boolean removeTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Remove (delete) the
with the
given name.
Trigger
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.
removeTrigger
in interface JobStore
triggerName
- The name of the Trigger
to be removed.groupName
- The group name of the Trigger
to be removed.true
if a Trigger
with the given
name & group was found and removed from the store.JobPersistenceException
public boolean replaceTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName, Trigger newTrigger) throws JobPersistenceException
JobStore
Remove (delete) the
with the
given name, and store the new given one - which must be associated
with the same job.
Trigger
replaceTrigger
in interface JobStore
triggerName
- The name of the Trigger
to be removed.groupName
- The group name of the Trigger
to be removed.newTrigger
- The new Trigger
to be stored.true
if a Trigger
with the given
name & group was found and removed from the store.JobPersistenceException
JobStore.replaceTrigger(org.quartz.core.SchedulingContext, java.lang.String, java.lang.String, org.quartz.Trigger)
public Trigger retrieveTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Retrieve the given
.
Trigger
retrieveTrigger
in interface JobStore
triggerName
- The name of the Trigger
to be retrieved.groupName
- The group name of the Trigger
to be retrieved.Trigger
, or null if there is no
match.JobPersistenceException
public int getTriggerState(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Get the current state of the identified
.
Trigger
getTriggerState
in interface JobStore
JobPersistenceException
Trigger.STATE_NORMAL
,
Trigger.STATE_PAUSED
,
Trigger.STATE_COMPLETE
,
Trigger.STATE_ERROR
,
Trigger.STATE_NONE
public int getTriggerState(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
public void storeCalendar(SchedulingContext ctxt, java.lang.String calName, Calendar calendar, boolean replaceExisting, boolean updateTriggers) throws ObjectAlreadyExistsException, JobPersistenceException
Store the given
.
Calendar
storeCalendar
in interface JobStore
calName
- The name of the calendar.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 Trigger
s 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
.ObjectAlreadyExistsException
- if a Calendar
with the same name already
exists, and replaceExisting is set to false.JobPersistenceException
public boolean removeCalendar(SchedulingContext ctxt, java.lang.String calName) throws JobPersistenceException
Remove (delete) the
with the
given name.
Calendar
If removal of the Calendar
would result in
JobPersistenceException
will be thrown.
removeCalendar
in interface JobStore
calName
- The name of the Calendar
to be removed.true
if a Calendar
with the given name
was found and removed from the store.JobPersistenceException
public Calendar retrieveCalendar(SchedulingContext ctxt, java.lang.String calName) throws JobPersistenceException
Retrieve the given
.
Trigger
retrieveCalendar
in interface JobStore
calName
- The name of the Calendar
to be retrieved.Calendar
, or null if there is no
match.JobPersistenceException
public int getNumberOfJobs(SchedulingContext ctxt) throws JobPersistenceException
Get the number of
s that are
stored in the Job
JobStore
.
getNumberOfJobs
in interface JobStore
JobPersistenceException
public int getNumberOfTriggers(SchedulingContext ctxt) throws JobPersistenceException
Get the number of
s that are
stored in the Trigger
JobsStore
.
getNumberOfTriggers
in interface JobStore
JobPersistenceException
public int getNumberOfCalendars(SchedulingContext ctxt) throws JobPersistenceException
Get the number of
s that are
stored in the Calendar
JobsStore
.
getNumberOfCalendars
in interface JobStore
JobPersistenceException
public java.lang.String[] getJobNames(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Get the names of all of the
s that
have the given group name.
Job
If there are no jobs in the given group name, the result should be a
zero-length array (not null
).
getJobNames
in interface JobStore
JobPersistenceException
public java.lang.String[] getTriggerNames(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Get the names of all of the
s
that have the given group name.
Trigger
If there are no triggers in the given group name, the result should be a
zero-length array (not null
).
getTriggerNames
in interface JobStore
JobPersistenceException
public java.lang.String[] getJobGroupNames(SchedulingContext ctxt) throws JobPersistenceException
Get the names of all of the
groups.
Job
If there are no known group names, the result should be a zero-length
array (not null
).
getJobGroupNames
in interface JobStore
JobPersistenceException
public java.lang.String[] getTriggerGroupNames(SchedulingContext ctxt) throws JobPersistenceException
Get the names of all of the
groups.
Trigger
If there are no known group names, the result should be a zero-length
array (not null
).
getTriggerGroupNames
in interface JobStore
JobPersistenceException
public java.lang.String[] getCalendarNames(SchedulingContext ctxt) throws JobPersistenceException
Get the names of all of the
s
in the Calendar
JobStore
.
If there are no Calendars in the given group name, the result should be
a zero-length array (not null
).
getCalendarNames
in interface JobStore
JobPersistenceException
public Trigger[] getTriggersForJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
Get all of the Triggers that are associated to the given Job.
If there are no matches, a zero-length array should be returned.
getTriggersForJob
in interface JobStore
JobPersistenceException
public void pauseTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Pause the
with the given name.
Trigger
pauseTrigger
in interface JobStore
JobPersistenceException
resumeTrigger(SchedulingContext, String, String)
public void pauseTrigger(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Pause the
with the given name.
Trigger
public void pauseJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
Pause the
with the given name - by
pausing all of its current Job
Trigger
s.
pauseJob
in interface JobStore
JobPersistenceException
resumeJob(SchedulingContext, String, String)
public void pauseJobGroup(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Pause all of the
in the given
group - by pausing all of their Job
sTrigger
s.
pauseJobGroup
in interface JobStore
JobPersistenceException
resumeJobGroup(SchedulingContext, String)
public void resumeTrigger(SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) the
with the
given name.
Trigger
If the Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
resumeTrigger
in interface JobStore
JobPersistenceException
pauseTrigger(SchedulingContext, String, String)
public void resumeTrigger(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) the
with the
given name.
Trigger
If the Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
public void resumeJob(SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) the
with the
given name.
Job
If any of the Job
'sTrigger
s missed one
or more fire-times, then the Trigger
's misfire
instruction will be applied.
resumeJob
in interface JobStore
JobPersistenceException
pauseJob(SchedulingContext, String, String)
public void resumeJobGroup(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) all of the
in
the given group.
Job
s
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.
resumeJobGroup
in interface JobStore
JobPersistenceException
pauseJobGroup(SchedulingContext, String)
public void pauseTriggerGroup(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Pause all of the
in the
given group.
Trigger
s
pauseTriggerGroup
in interface JobStore
JobPersistenceException
resumeTriggerGroup(SchedulingContext, String)
public void pauseTriggerGroup(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Pause all of the
in the
given group.
Trigger
s
public java.util.Set getPausedTriggerGroups(SchedulingContext ctxt) throws JobPersistenceException
getPausedTriggerGroups
in interface JobStore
JobPersistenceException
public java.util.Set getPausedTriggerGroups(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
Pause all of the
in the
given group.
Trigger
s
public void resumeTriggerGroup(SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) all of the
in the given group.
Trigger
s
If any Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
resumeTriggerGroup
in interface JobStore
JobPersistenceException
pauseTriggerGroup(SchedulingContext, String)
public void resumeTriggerGroup(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
Resume (un-pause) all of the
in the given group.
Trigger
s
If any Trigger
missed one or more fire-times, then the
Trigger
's misfire instruction will be applied.
public void pauseAll(SchedulingContext ctxt) throws JobPersistenceException
Pause all triggers - equivalent of calling pauseTriggerGroup(group)
on every group.
When resumeAll()
is called (to un-pause), trigger misfire
instructions WILL be applied.
pauseAll
in interface JobStore
JobPersistenceException
resumeAll(SchedulingContext)
,
pauseTriggerGroup(SchedulingContext, String)
public void pauseAll(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
Pause all triggers - equivalent of calling pauseTriggerGroup(group)
on every group.
When resumeAll()
is called (to un-pause), trigger misfire
instructions WILL be applied.
public void resumeAll(SchedulingContext ctxt) throws JobPersistenceException
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.
resumeAll
in interface JobStore
JobPersistenceException
pauseAll(SchedulingContext)
public void resumeAll(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
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.
JobPersistenceException
pauseAll(SchedulingContext)
public Trigger acquireNextTrigger(SchedulingContext ctxt, long noLaterThan) throws JobPersistenceException
Get a handle to the next N triggers to be fired, and mark them as 'reserved' by the calling scheduler.
acquireNextTrigger
in interface JobStore
noLaterThan
- If > 0, the JobStore should only return a Trigger
that will fire no later than the time represented in this value as
milliseconds.JobPersistenceException
releaseAcquiredTrigger(SchedulingContext, Trigger)
public void releaseAcquiredTrigger(SchedulingContext ctxt, Trigger trigger) throws JobPersistenceException
Inform the JobStore
that the scheduler no longer plans to
fire the given Trigger
, that it had previously acquired
(reserved).
releaseAcquiredTrigger
in interface JobStore
JobPersistenceException
public TriggerFiredBundle triggerFired(SchedulingContext ctxt, Trigger trigger) throws JobPersistenceException
Inform the JobStore
that the scheduler is now firing the
given Trigger
(executing its associated Job
),
that it had previously acquired (reserved).
triggerFired
in interface JobStore
JobPersistenceException
public void triggeredJobComplete(SchedulingContext ctxt, Trigger trigger, JobDetail jobDetail, int triggerInstCode) throws JobPersistenceException
Inform the JobStore
that the scheduler has completed the
firing of the given Trigger
(and the execution its
associated Job
), and that the
in the given JobDataMap
JobDetail
should be updated if the Job
is stateful.
triggeredJobComplete
in interface JobStore
JobPersistenceException
public void setLockHandler(Semaphore lockHandler)
public java.lang.Object executeWithoutLock(org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionCallback txCallback) throws JobPersistenceException
This method just forwards to executeInLock() with a null lockName.
JobPersistenceException
executeInLock(String, TransactionCallback)