public interface LockDAO
Modifier and Type | Method and Description |
---|---|
void |
getLock(org.alfresco.service.namespace.QName lockQName,
String lockToken,
long timeToLive)
Acquire a given exclusive lock, assigning it (and any implicitly shared locks) a
timeout.
|
void |
refreshLock(org.alfresco.service.namespace.QName lockQName,
String lockToken,
long timeToLive)
Refresh a held lock.
|
boolean |
releaseLock(org.alfresco.service.namespace.QName lockQName,
String lockToken,
boolean optimistic)
Release a lock.
|
void getLock(org.alfresco.service.namespace.QName lockQName, String lockToken, long timeToLive)
A lock can be re-taken if it has expired and if the lock token has not changed
lockQName
- the unique name of the lock to acquirelockToken
- the potential lock token (max 36 chars)timeToLive
- the time (in milliseconds) that the lock must remainLockAcquisitionException
- on failurevoid refreshLock(org.alfresco.service.namespace.QName lockQName, String lockToken, long timeToLive)
lockQName
- the unique name of the lock to updatelockToken
- the lock token for the lock heldtimeToLive
- the new time to live (in milliseconds)LockAcquisitionException
- on failureboolean releaseLock(org.alfresco.service.namespace.QName lockQName, String lockToken, boolean optimistic)
lockQName
- the unique name of the lock to releaselockToken
- the current lock tokenoptimistic
- true if the release attempt is enough even
if the number of released locks was incorrect.LockAcquisitionException
- if the number of locks released was incorrect
and pessimistic release is requested.Copyright © 2005–2017 Alfresco Software. All rights reserved.