mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Lock DAO
- Use LockAcquisitionException instead of boolean for failures - Lock update with TTL=0 sets the start and expiry time to 0 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13956 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.locks;
|
||||
|
||||
import org.alfresco.repo.lock.LockAcquisitionException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
@@ -45,8 +46,9 @@ public interface LockDAO
|
||||
* @param timeToLive the time (in milliseconds) that the lock must remain
|
||||
* @return Returns <tt>true</tt> if the lock was taken,
|
||||
* otherwise <tt>false</tt>
|
||||
* @throws LockAcquisitionException on failure
|
||||
*/
|
||||
boolean getLock(QName lockQName, String lockToken, long timeToLive);
|
||||
void getLock(QName lockQName, String lockToken, long timeToLive);
|
||||
|
||||
/**
|
||||
* Refresh a held lock. This is successful if the lock in question still exists
|
||||
@@ -58,8 +60,9 @@ public interface LockDAO
|
||||
* @param timeToLive the new time to live (in milliseconds)
|
||||
* @return Returns <tt>true</tt> if the lock was updated,
|
||||
* otherwise <tt>false</tt>
|
||||
* @throws LockAcquisitionException on failure
|
||||
*/
|
||||
boolean refreshLock(QName lockQName, String lockToken, long timeToLive);
|
||||
void refreshLock(QName lockQName, String lockToken, long timeToLive);
|
||||
|
||||
/**
|
||||
* Release a lock. The lock token must still apply and all the shared and exclusive
|
||||
@@ -75,5 +78,5 @@ public interface LockDAO
|
||||
* (still) held under the lock token and were
|
||||
* valid at the time of release, otherwise <tt>false</tt>
|
||||
*/
|
||||
boolean releaseLock(QName lockQName, String lockToken);
|
||||
void releaseLock(QName lockQName, String lockToken);
|
||||
}
|
||||
|
Reference in New Issue
Block a user