mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
Refs #3 Pessimistic locking (JavaDoc added)
This commit is contained in:
parent
b061117997
commit
4a28fe8e17
@ -18,13 +18,40 @@ public interface LockManagerAPI {
|
|||||||
|
|
||||||
String NAME = "cuba_LockManager";
|
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);
|
LockInfo lock(String name, String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unlock object
|
||||||
|
* @param name locking object name
|
||||||
|
* @param id locking object ID
|
||||||
|
*/
|
||||||
void unlock(String name, String 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);
|
LockInfo getLockInfo(String name, String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of current locks
|
||||||
|
*/
|
||||||
List<LockInfo> getCurrentLocks();
|
List<LockInfo> getCurrentLocks();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process locks expiring. All expired locks will be removed.
|
||||||
|
*/
|
||||||
void expireLocks();
|
void expireLocks();
|
||||||
}
|
}
|
||||||
|
@ -18,11 +18,35 @@ public interface LockService {
|
|||||||
|
|
||||||
String NAME = "cuba_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);
|
LockInfo lock(String name, String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unlock object
|
||||||
|
* @param name locking object name
|
||||||
|
* @param id locking object ID
|
||||||
|
*/
|
||||||
void unlock(String name, String 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);
|
LockInfo getLockInfo(String name, String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of current locks
|
||||||
|
*/
|
||||||
List<LockInfo> getCurrentLocks();
|
List<LockInfo> getCurrentLocks();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user