mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -171,14 +171,27 @@ public interface JobLockService
|
|||||||
/**
|
/**
|
||||||
* Release the lock using a valid lock token. The lock can have expired or even been taken
|
* 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
|
* 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 lockToken the lock token returned when the lock was acquired
|
||||||
* @param lockQName the name of the previously-acquired lock
|
* @param lockQName the name of the previously-acquired lock
|
||||||
* @return <tt>true</tt> if the lock was valid and released otherwise
|
* @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
|
* <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.
|
* Interface for implementations that need a timed callback in order to refresh the lock.
|
||||||
|
@@ -419,7 +419,15 @@ public class JobLockServiceImpl implements JobLockService
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public boolean releaseLock(final String lockToken, final QName lockQName)
|
public void releaseLock(final String lockToken, final QName lockQName)
|
||||||
|
{
|
||||||
|
releaseLockVerify(lockToken, lockQName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public boolean releaseLockVerify(final String lockToken, final QName lockQName)
|
||||||
{
|
{
|
||||||
RetryingTransactionCallback<Boolean> releaseCallback = new RetryingTransactionCallback<Boolean>()
|
RetryingTransactionCallback<Boolean> releaseCallback = new RetryingTransactionCallback<Boolean>()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user