|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.quartz.impl.jdbcjobstore.JobStoreSupport
Contains base functionality for JDBC-based JobStore implementations.
Field Summary | |
protected java.util.HashMap |
calendarCache
|
protected java.lang.Class |
delegateClass
|
protected java.lang.String |
dsName
|
protected boolean |
firstCheckIn
|
protected java.lang.String |
instanceId
|
protected long |
lastCheckin
|
protected static java.lang.String |
LOCK_CALENDAR_ACCESS
|
protected static java.lang.String |
LOCK_JOB_ACCESS
|
protected static java.lang.String |
LOCK_MISFIRE_ACCESS
|
protected static java.lang.String |
LOCK_STATE_ACCESS
|
protected static java.lang.String |
LOCK_TRIGGER_ACCESS
|
protected java.lang.String |
tablePrefix
|
Constructor Summary | |
JobStoreSupport()
|
Method Summary | |
protected Trigger |
acquireNextTrigger(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected boolean |
calendarExists(java.sql.Connection conn,
java.lang.String calName)
|
protected abstract void |
cleanVolatileTriggerAndJobs()
Removes all volatile data |
protected void |
cleanVolatileTriggerAndJobs(java.sql.Connection conn)
Removes all volatile data. |
protected java.util.List |
clusterCheckIn(java.sql.Connection conn)
|
protected void |
clusterRecover(java.sql.Connection conn,
java.util.List failedInstances)
|
protected abstract boolean |
doCheckin()
|
protected abstract boolean |
doRecoverMisfires()
|
protected java.lang.String[] |
getCalendarNames(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected ClassLoadHelper |
getClassLoadHelper()
|
long |
getClusterCheckinInterval()
Get the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. |
java.lang.String |
getDataSource()
Get the name of the DataSource that should be
used for performing database functions. |
protected DriverDelegate |
getDelegate()
Get the driver delegate for DB operations. |
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). |
protected java.lang.String[] |
getJobGroupNames(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected java.lang.String[] |
getJobNames(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String groupName)
|
protected Semaphore |
getLockHandler()
|
long |
getMisfireThreshold()
|
protected long |
getMisfireTime()
|
protected int |
getNumberOfCalendars(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected int |
getNumberOfJobs(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected int |
getNumberOfTriggers(java.sql.Connection conn,
SchedulingContext ctxt)
|
java.lang.String |
getSelectWithLockSQL()
|
java.lang.String |
getTablePrefix()
Get the prefix that should be pre-pended to all table names. |
protected java.lang.String[] |
getTriggerGroupNames(java.sql.Connection conn,
SchedulingContext ctxt)
|
protected java.lang.String[] |
getTriggerNames(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String groupName)
|
protected Trigger[] |
getTriggersForJob(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
|
int |
getTriggerState(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
|
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 the it a chance
to initialize. |
boolean |
isClustered()
Get whether this instance is part of a cluster. |
boolean |
isDontSetAutoCommitFalse()
|
protected boolean |
jobExists(java.sql.Connection conn,
java.lang.String jobName,
java.lang.String groupName)
Check existence of a given job. |
void |
pauseAll(java.sql.Connection conn,
SchedulingContext ctxt)
Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group. |
void |
pauseTrigger(java.sql.Connection conn,
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. |
protected abstract void |
recoverJobs()
Will recover any failed or misfired jobs and clean up the data store as appropriate. |
protected void |
recoverJobs(java.sql.Connection conn)
Will recover any failed or misfired jobs and clean up the data store as appropriate. |
protected boolean |
recoverMisfiredJobs(java.sql.Connection conn)
|
protected void |
releaseAcquiredTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
Trigger trigger)
|
protected boolean |
removeCalendar(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String calName)
|
protected boolean |
removeJob(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName,
boolean activeDeleteSafe)
|
protected boolean |
removeTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
|
void |
resumeAll(java.sql.Connection conn,
SchedulingContext ctxt)
protected |
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 |
resumeTriggerGroup(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String groupName)
Resume (un-pause) all of the in the given
group. |
protected Calendar |
retrieveCalendar(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String calName)
|
protected JobDetail |
retrieveJob(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String jobName,
java.lang.String groupName)
|
protected Trigger |
retrieveTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName)
|
void |
setClusterCheckinInterval(long l)
Set the frequency (in milliseconds) at which this instance "checks-in" with the other instances of the cluster. |
void |
setDataSource(java.lang.String dsName)
Set the name of the DataSource that should be
used for performing database functions. |
void |
setDontSetAutoCommitFalse(boolean b)
Don't call set autocommit(false) on connections obtained from the DataSource. |
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 |
setIsClustered(boolean isClustered)
Set whether this instance is part of a cluster. |
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 |
setUseDBLocks(boolean useDBLocks)
Set whether this instance should use database-based thread synchronization. |
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. |
protected void |
signalSchedulingChange()
|
protected void |
storeCalendar(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String calName,
Calendar calendar,
boolean replaceExisting)
|
protected void |
storeJob(java.sql.Connection conn,
SchedulingContext ctxt,
JobDetail newJob,
boolean replaceExisting)
Insert or update a job. |
protected void |
storeTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
Trigger newTrigger,
boolean replaceExisting,
java.lang.String state,
boolean forceState)
Insert or update a trigger. |
boolean |
supportsPersistence()
|
protected void |
triggeredJobComplete(java.sql.Connection conn,
SchedulingContext ctxt,
Trigger trigger,
JobDetail jobDetail,
int triggerInstCode)
|
protected boolean |
triggerExists(java.sql.Connection conn,
java.lang.String triggerName,
java.lang.String groupName)
Check existence of a given trigger. |
protected TriggerFiredBundle |
triggerFired(java.sql.Connection conn,
SchedulingContext ctxt,
Trigger trigger)
|
protected void |
updateMisfiredTrigger(java.sql.Connection conn,
SchedulingContext ctxt,
java.lang.String triggerName,
java.lang.String groupName,
java.lang.String newStateIfNotComplete,
boolean forceState)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.String LOCK_TRIGGER_ACCESS
protected static java.lang.String LOCK_JOB_ACCESS
protected static java.lang.String LOCK_CALENDAR_ACCESS
protected static java.lang.String LOCK_STATE_ACCESS
protected static java.lang.String LOCK_MISFIRE_ACCESS
protected java.lang.String dsName
protected java.lang.String tablePrefix
protected java.lang.String instanceId
protected java.lang.Class delegateClass
protected java.util.HashMap calendarCache
protected boolean firstCheckIn
protected long lastCheckin
Constructor Detail |
public JobStoreSupport()
Method Detail |
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 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 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 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 long getMisfireThreshold()
public void setMisfireThreshold(long misfireThreshold)
misfireThreshold
- public boolean isDontSetAutoCommitFalse()
public void setDontSetAutoCommitFalse(boolean b)
b
- public void setDriverDelegateClass(java.lang.String delegateClassName) throws InvalidConfigurationException
Set the JDBC driver delegate class.
delegateClassName
- the delegate class name
InvalidConfigurationException
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
protected ClassLoadHelper getClassLoadHelper()
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException
Called by the QuartzScheduler before the
JobStore
is used, in order to give the it a chance
to initialize.
initialize
in interface JobStore
SchedulerConfigException
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.
shutdown
in interface JobStore
public boolean supportsPersistence()
supportsPersistence
in interface JobStore
protected abstract void cleanVolatileTriggerAndJobs() throws JobPersistenceException
Removes all volatile data
JobPersistenceException
- if jobs could not be recoveredprotected void cleanVolatileTriggerAndJobs(java.sql.Connection conn) throws JobPersistenceException
Removes all volatile data.
JobPersistenceException
- if jobs could not be recoveredprotected abstract void recoverJobs() throws JobPersistenceException
Will recover any failed or misfired jobs and clean up the data store as appropriate.
JobPersistenceException
- if jobs could not be recoveredprotected void recoverJobs(java.sql.Connection conn) throws JobPersistenceException
Will recover any failed or misfired jobs and clean up the data store as appropriate.
JobPersistenceException
- if jobs could not be recoveredprotected long getMisfireTime()
protected boolean recoverMisfiredJobs(java.sql.Connection conn) throws JobPersistenceException, NoSuchDelegateException, java.sql.SQLException, java.lang.ClassNotFoundException, java.io.IOException
JobPersistenceException
NoSuchDelegateException
java.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException
protected void updateMisfiredTrigger(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName, java.lang.String newStateIfNotComplete, boolean forceState) throws JobPersistenceException
JobPersistenceException
protected void storeJob(java.sql.Connection conn, SchedulingContext ctxt, JobDetail newJob, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
Insert or update a job.
ObjectAlreadyExistsException
JobPersistenceException
protected boolean jobExists(java.sql.Connection conn, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
Check existence of a given job.
JobPersistenceException
protected void storeTrigger(java.sql.Connection conn, SchedulingContext ctxt, Trigger newTrigger, boolean replaceExisting, java.lang.String state, boolean forceState) throws ObjectAlreadyExistsException, JobPersistenceException
Insert or update a trigger.
ObjectAlreadyExistsException
JobPersistenceException
protected boolean triggerExists(java.sql.Connection conn, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
Check existence of a given trigger.
JobPersistenceException
protected boolean removeJob(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName, boolean activeDeleteSafe) throws JobPersistenceException
JobPersistenceException
protected JobDetail retrieveJob(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
protected boolean removeTrigger(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
protected Trigger retrieveTrigger(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
public int getTriggerState(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String triggerName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
protected void storeCalendar(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String calName, Calendar calendar, boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException
ObjectAlreadyExistsException
JobPersistenceException
protected boolean calendarExists(java.sql.Connection conn, java.lang.String calName) throws JobPersistenceException
JobPersistenceException
protected boolean removeCalendar(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String calName) throws JobPersistenceException
JobPersistenceException
protected Calendar retrieveCalendar(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String calName) throws JobPersistenceException
JobPersistenceException
protected int getNumberOfJobs(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected int getNumberOfTriggers(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected int getNumberOfCalendars(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected java.lang.String[] getJobNames(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
protected java.lang.String[] getTriggerNames(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
protected java.lang.String[] getJobGroupNames(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected java.lang.String[] getTriggerGroupNames(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected java.lang.String[] getCalendarNames(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected Trigger[] getTriggersForJob(java.sql.Connection conn, SchedulingContext ctxt, java.lang.String jobName, java.lang.String groupName) throws JobPersistenceException
JobPersistenceException
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
JobPersistenceException
resumeTrigger(Connection, 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.
JobPersistenceException
pauseTrigger(Connection, SchedulingContext, String, 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
JobPersistenceException
resumeTriggerGroup(Connection, 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.
JobPersistenceException
pauseTriggerGroup(Connection, 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.
JobPersistenceException
JobStore.resumeAll(SchedulingContext)
,
JobStore.pauseTriggerGroup(SchedulingContext, String)
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
JobStore.pauseAll(SchedulingContext)
protected Trigger acquireNextTrigger(java.sql.Connection conn, SchedulingContext ctxt) throws JobPersistenceException
JobPersistenceException
protected void releaseAcquiredTrigger(java.sql.Connection conn, SchedulingContext ctxt, Trigger trigger) throws JobPersistenceException
JobPersistenceException
protected TriggerFiredBundle triggerFired(java.sql.Connection conn, SchedulingContext ctxt, Trigger trigger) throws JobPersistenceException
JobPersistenceException
protected void triggeredJobComplete(java.sql.Connection conn, SchedulingContext ctxt, Trigger trigger, JobDetail jobDetail, int triggerInstCode) throws JobPersistenceException
JobPersistenceException
protected DriverDelegate getDelegate() throws NoSuchDelegateException
Get the driver delegate for DB operations.
NoSuchDelegateException
protected Semaphore getLockHandler()
protected abstract boolean doRecoverMisfires() throws JobPersistenceException
JobPersistenceException
protected void signalSchedulingChange()
protected abstract boolean doCheckin() throws JobPersistenceException
JobPersistenceException
protected java.util.List clusterCheckIn(java.sql.Connection conn) throws JobPersistenceException
JobPersistenceException
protected void clusterRecover(java.sql.Connection conn, java.util.List failedInstances) throws JobPersistenceException
JobPersistenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |