Refs #3 Pessimistic locking (JavaDoc added)

This commit is contained in:
Konstantin Krivopustov 2010-02-24 12:02:08 +00:00
parent b061117997
commit 4a28fe8e17
2 changed files with 51 additions and 0 deletions

View File

@ -18,13 +18,40 @@ public interface LockManagerAPI {
String NAME = "cuba_LockManager";
/**
* Try to lock object
* @param name locking object name
* @param id locking object ID
* @return <li>null in case of successful lock,
* <li>{@link com.haulmont.cuba.core.global.LockNotSupported} instance in case of locking is not configured for this object,
* <li>{@link LockInfo} instance in case of this object is already locked by someone
*/
LockInfo lock(String name, String id);
/**
* Unlock object
* @param name locking object name
* @param id locking object ID
*/
void unlock(String name, String id);
/**
* Get locking status for particular object
* @param name locking object name
* @param id locking object ID
* @return <li>null in case of no lock,
* <li>{@link com.haulmont.cuba.core.global.LockNotSupported} instance in case of locking is not configured for this object,
* <li>{@link LockInfo} instance in case of this object is locked by someone
*/
LockInfo getLockInfo(String name, String id);
/**
* List of current locks
*/
List<LockInfo> getCurrentLocks();
/**
* Process locks expiring. All expired locks will be removed.
*/
void expireLocks();
}

View File

@ -18,11 +18,35 @@ public interface LockService {
String NAME = "cuba_LockService";
/**
* Try to lock object
* @param name locking object name
* @param id locking object ID
* @return <li>null in case of successful lock,
* <li>{@link com.haulmont.cuba.core.global.LockNotSupported} instance in case of locking is not configured for this object,
* <li>{@link LockInfo} instance in case of this object is already locked by someone
*/
LockInfo lock(String name, String id);
/**
* Unlock object
* @param name locking object name
* @param id locking object ID
*/
void unlock(String name, String id);
/**
* Get locking status for particular object
* @param name locking object name
* @param id locking object ID
* @return <li>null in case of no lock,
* <li>{@link com.haulmont.cuba.core.global.LockNotSupported} instance in case of locking is not configured for this object,
* <li>{@link LockInfo} instance in case of this object is locked by someone
*/
LockInfo getLockInfo(String name, String id);
/**
* List of current locks
*/
List<LockInfo> getCurrentLocks();
}