org.quartz.impl.jdbcjobstore
Class JobStoreTX

java.lang.Object
  extended by org.quartz.impl.jdbcjobstore.JobStoreSupport
      extended by org.quartz.impl.jdbcjobstore.JobStoreTX
All Implemented Interfaces:
Constants, JobStore

public class JobStoreTX
extends JobStoreSupport

JobStoreTX is meant to be used in a standalone environment. Both commit and rollback will be handled by this class.

If you need a JobStore class to use within an application-server environment, use JobStoreCMT instead.

Author:
Jeffrey Wescott, James House

Nested Class Summary
 
Nested classes/interfaces inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
JobStoreSupport.RecoverMisfiredJobsResult, JobStoreSupport.TransactionCallback, JobStoreSupport.VoidTransactionCallback
 
Field Summary
 
Fields inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
calendarCache, delegateClass, delegateClassName, dsName, firstCheckIn, instanceId, instanceName, lastCheckin, LOCK_CALENDAR_ACCESS, LOCK_JOB_ACCESS, LOCK_MISFIRE_ACCESS, LOCK_STATE_ACCESS, LOCK_TRIGGER_ACCESS, maxToRecoverAtATime, sigChangeForTxCompletion, tablePrefix, useProperties
 
Fields inherited from interface org.quartz.impl.jdbcjobstore.Constants
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 Summary
JobStoreTX()
           
 
Method Summary
protected  Object executeInLock(String lockName, JobStoreSupport.TransactionCallback txCallback)
          Execute the given callback having optionally aquired the given lock.
protected  Connection getNonManagedTXConnection()
          For JobStoreTX, the non-managed TX connection is just the normal connection because it is not CMT.
 void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)
           Called by the QuartzScheduler before the JobStore is used, in order to give it a chance to initialize.
 
Methods inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
acquireNextTrigger, acquireNextTrigger, calcFailedIfAfter, calendarExists, canUseProperties, checkBlockedState, cleanupConnection, cleanVolatileTriggerAndJobs, cleanVolatileTriggerAndJobs, clearAndGetSignalSchedulingChangeOnTxCompletion, closeConnection, clusterCheckIn, clusterRecover, commitConnection, doCheckin, doRecoverMisfires, executeInLock, executeInNonManagedTXLock, executeInNonManagedTXLock, executeWithoutLock, findFailedInstances, getAttributeRestoringConnection, getCalendarNames, getCalendarNames, getClassLoadHelper, getClusterCheckinInterval, getConnection, getDataSource, getDbRetryInterval, getDelegate, getDoubleCheckLockMisfireHandler, getDriverDelegateClass, getEstimatedTimeToReleaseAndAcquireTrigger, getFiredTriggerRecordId, getInstanceId, getInstanceName, getJobGroupNames, getJobGroupNames, getJobNames, getJobNames, getLockHandler, getLog, getMakeThreadsDaemons, getMaxMisfiresToHandleAtATime, getMisfireThreshold, getMisfireTime, getNumberOfCalendars, getNumberOfCalendars, getNumberOfJobs, getNumberOfJobs, getNumberOfTriggers, getNumberOfTriggers, getPausedTriggerGroups, getPausedTriggerGroups, getSelectWithLockSQL, getTablePrefix, getTriggerGroupNames, getTriggerGroupNames, getTriggerNames, getTriggerNames, getTriggersForJob, getTriggersForJob, getTriggerState, getTriggerState, getUseDBLocks, isAcquireTriggersWithinLock, isClustered, isDontSetAutoCommitFalse, isLockOnInsert, isThreadsInheritInitializersClassLoadContext, isTxIsolationLevelSerializable, jobExists, logWarnIfNonZero, pauseAll, pauseAll, pauseJob, pauseJobGroup, pauseTrigger, pauseTrigger, pauseTriggerGroup, pauseTriggerGroup, recoverJobs, recoverJobs, recoverMisfiredJobs, releaseAcquiredTrigger, releaseAcquiredTrigger, releaseLock, removeCalendar, removeCalendar, removeJob, removeJob, removeTrigger, removeTrigger, replaceTrigger, replaceTrigger, resumeAll, resumeAll, resumeJob, resumeJobGroup, resumeTrigger, resumeTrigger, resumeTriggerGroup, resumeTriggerGroup, retrieveCalendar, retrieveCalendar, retrieveJob, retrieveJob, retrieveTrigger, retrieveTrigger, retrieveTrigger, rollbackConnection, schedulerStarted, setAcquireTriggersWithinLock, setClusterCheckinInterval, setDataSource, setDbRetryInterval, setDontSetAutoCommitFalse, setDoubleCheckLockMisfireHandler, setDriverDelegateClass, setInstanceId, setInstanceName, setIsClustered, setLockHandler, setLockOnInsert, setMakeThreadsDaemons, setMaxMisfiresToHandleAtATime, setMisfireThreshold, setSelectWithLockSQL, setTablePrefix, setThreadsInheritInitializersClassLoadContext, setTxIsolationLevelSerializable, setUseDBLocks, setUseProperties, shutdown, signalSchedulingChangeImmediately, signalSchedulingChangeOnTxCompletion, storeCalendar, storeCalendar, storeJob, storeJob, storeJobAndTrigger, storeTrigger, storeTrigger, supportsPersistence, triggeredJobComplete, triggeredJobComplete, triggerExists, triggerFired, triggerFired, updateMisfiredTrigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobStoreTX

public JobStoreTX()
Method Detail

initialize

public void initialize(ClassLoadHelper loadHelper,
                       SchedulerSignaler signaler)
                throws SchedulerConfigException
Description copied from class: JobStoreSupport

Called by the QuartzScheduler before the JobStore is used, in order to give it a chance to initialize.

Specified by:
initialize in interface JobStore
Overrides:
initialize in class JobStoreSupport
Throws:
SchedulerConfigException

getNonManagedTXConnection

protected Connection getNonManagedTXConnection()
                                        throws JobPersistenceException
For JobStoreTX, the non-managed TX connection is just the normal connection because it is not CMT.

Specified by:
getNonManagedTXConnection in class JobStoreSupport
Throws:
JobPersistenceException
See Also:
JobStoreSupport.getConnection()

executeInLock

protected Object executeInLock(String lockName,
                               JobStoreSupport.TransactionCallback txCallback)
                        throws JobPersistenceException
Execute the given callback having optionally aquired the given lock. For JobStoreTX, because it manages its own transactions and only has the one datasource, this is the same behavior as executeInNonManagedTXLock().

Specified by:
executeInLock in class JobStoreSupport
Parameters:
lockName - The name of the lock to aquire, for example "TRIGGER_ACCESS". If null, then no lock is aquired, but the lockCallback is still executed in a transaction.
Throws:
JobPersistenceException
See Also:
JobStoreSupport.executeInNonManagedTXLock(String, TransactionCallback), JobStoreSupport.executeInLock(String, TransactionCallback), JobStoreSupport.getNonManagedTXConnection(), JobStoreSupport.getConnection()


Copyright 2001-2011, Terracotta, Inc.