Fixes ALF-19964: Breaking API change in JobLockService.releaseLock

- Reverted releaseLock to return void
- Added "releaseLockVerify" that returns boolean

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@56164 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Brian Remmington
2013-09-30 11:52:50 +00:00
parent d27eecf069
commit 1521b6b76f
2 changed files with 24 additions and 3 deletions

View File

@@ -171,14 +171,27 @@ public interface JobLockService
/**
* Release the lock using a valid lock token. The lock can have expired or even been taken
* by another processes (i.e. the lock token will no longer be valid); none of this will
* prevent the method from succeeding.
* prevent the method from succeeding. This operation is functionally the same as the newer
* {@link #releaseLockVerify(String, QName)} operation, other than it returns void. Retained
* for backwards-compatibility.
*
* @param lockToken the lock token returned when the lock was acquired
* @param lockQName the name of the previously-acquired lock
*/
void releaseLock(String lockToken, QName lockQName);
/**
* Release the lock using a valid lock token. The lock can have expired or even been taken
* by another processes (i.e. the lock token will no longer be valid); none of this will
* prevent the method from succeeding. Functionally similar to {@link #releaseLock(String, QName)}, but
* this newer operation indicates whether a lock was actually released by its return value.
*
* @param lockToken the lock token returned when the lock was acquired
* @param lockQName the name of the previously-acquired lock
* @return <tt>true</tt> if the lock was valid and released otherwise
* <tt>false</tt> if the lock was no longer valid in any case
*/
boolean releaseLock(String lockToken, QName lockQName);
boolean releaseLockVerify(String lockToken, QName lockQName);
/**
* Interface for implementations that need a timed callback in order to refresh the lock.