- 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:
Derek Hulley
2009-04-15 13:52:12 +00:00
parent 6a20eda27f
commit 5bda334c22
6 changed files with 180 additions and 57 deletions

View File

@@ -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);
}