Issue Details (XML | Word | Printable)

Key: QUARTZ-441
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: James House
Reporter: Jasper Rosenberg
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

Support custom Semaphore (lock handler) implementations

Created: 10/May/06 04:39 PM   Updated: 24/Dec/07 01:30 AM
Return to search
Component/s: Job Stores
Affects Version/s: 1.6
Fix Version/s: 1.6


 Description  « Hide
Support optional property "org.quartz.jobStore.lockHandler.class" which, if provided, overrides the setting of an internal Semaphore lock handler in JobStoreSupport. This should also support setting lockHandler specific bean properties, for example "org.quartz.jobStore.lockHandler.transactionManagerJNDIName=javax.transaction.TransactionManager"

Changes:

1. Update the ConfigJobStoreCMT/TX html pages to document the new property, add missing related property org.quartz.jobStore.useDBLocks, and group lock handler related properties together (org.quartz.jobStore.selectWithLockSQL and org.quartz.jobStore.useDBLocks). Also fix formatting of org.quartz.jobStore.dontSetNonManagedTXConnectionAutoCommitFalse property which was not in table correctly.

2. Enhance PropertiesParser.getPropertyGroup() to also support an array of prefixes to ignore, so that the lockHandler properties can be excluded when setting the "org.quartz.jobStore" bean properties, and update StdSchedulerFactory to try to set the lockHandler if the job store is JDBC based.

3. In JobStoreCMT/JobStoreSupport.initialize(), don't set the lockHandler/useDBLocks if a lockHandler has already been set (presumably by the StdSchedulerFactory).

4. In JobStoreCMT.executeInLock(), now do check if lock handler requires a connection before acquiring the lock (just like for executeInNonManagedTXLock()), because now that a user can provide their own Semaphore implementation, they may provide a cluster safe lock handler that doesn't require the database.

5. Add method "boolean requiresConnection()" to the Semaphore interface to indicate whether it actually requires a Connection be passed to it. SimpleSemaphore will return false for this and StdRowLockSemaphore return true. JobStoreCMT.executeInLock()/executeInNonManagedTXLock() should use this method to determine if getting a Connection can be deferred rather than the value of getUseDBLocks().

6. Update SimpleSemaphore and StdRowLockSemaphore javadocs to clarify that these are internal Semaphore implentations (and by implication shouldn't need to be used as a value for "org.quartz.jobStore.lockHandler.class".)

7. Update StdRowLockSemaphore with a default constructor and bean properties so it can be used as a value for "org.quartz.jobStore.lockHandler.class" if someone really wants to (though it should never be unnecessary).

8. Remove unused "init()" method of SimpleSemaphore.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.