org.alfresco.repo.domain.locks
Interface LockDAO

All Known Implementing Classes:
AbstractLockDAOImpl, LockDAOImpl

public interface LockDAO

DAO services for alf_lock and related tables

Since:
3.2

Method Summary
 void getLock(org.alfresco.service.namespace.QName lockQName, java.lang.String lockToken, long timeToLive)
          Aquire a given exclusive lock, assigning it (and any implicitly shared locks) a timeout.
 void refreshLock(org.alfresco.service.namespace.QName lockQName, java.lang.String lockToken, long timeToLive)
          Refresh a held lock.
 void releaseLock(org.alfresco.service.namespace.QName lockQName, java.lang.String lockToken)
          Release a lock.
 

Method Detail

getLock

void getLock(org.alfresco.service.namespace.QName lockQName,
             java.lang.String lockToken,
             long timeToLive)
Aquire a given exclusive lock, assigning it (and any implicitly shared locks) a timeout. All shared locks are implicitly taken as well.

A lock can be re-taken if it has expired and if the lock token has not changed

Parameters:
lockQName - the unique name of the lock to acquire
lockToken - the potential lock token (max 36 chars)
timeToLive - the time (in milliseconds) that the lock must remain
Throws:
LockAcquisitionException - on failure

refreshLock

void refreshLock(org.alfresco.service.namespace.QName lockQName,
                 java.lang.String lockToken,
                 long timeToLive)
Refresh a held lock. This is successful if the lock in question still exists and if the lock token has not changed. Lock expiry does not prevent the lock from being refreshed.

Parameters:
lockQName - the unique name of the lock to update
lockToken - the lock token for the lock held
timeToLive - the new time to live (in milliseconds)
Throws:
LockAcquisitionException - on failure

releaseLock

void releaseLock(org.alfresco.service.namespace.QName lockQName,
                 java.lang.String lockToken)
Release a lock. The lock token must still apply and all the shared and exclusive locks need to still be present. Lock expiration does not prevent this operation from succeeding.

Note: Failure to release a lock due to a exception condition is dealt with by passing the exception out.

Parameters:
lockQName - the unique name of the lock to release
lockToken - the current lock token


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.