| org.apache.commons.transaction.locking.MultiLevelLock
MultiLevelLock | public interface MultiLevelLock (Code) | | A multi level lock. Depending on the implementation more than one owner may own a certain lock level on the same lock.
version: $Id: MultiLevelLock.java 493628 2007-01-07 01:42:48Z joerg $ See Also: LockManager |
Method Summary | |
public boolean | acquire(Object ownerId, int targetLockLevel, boolean wait, boolean reentrant, long timeoutMSecs) Tries to acquire a certain lock level on this lock. | public int | getLockLevel(Object ownerId) Retuns the highest lock level the specified owner holds on this lock or 0 if it holds no locks at all. | public boolean | release(Object ownerId) Releases any lock levels the specified owner may hold on this lock. |
acquire | public boolean acquire(Object ownerId, int targetLockLevel, boolean wait, boolean reentrant, long timeoutMSecs) throws InterruptedException(Code) | | Tries to acquire a certain lock level on this lock.
Parameters: ownerId - a unique id identifying the entity that wants to acquire a certain lock level on this lock Parameters: targetLockLevel - the lock level to acquire Parameters: wait - true if this method shall block when the desired lock level can not be acquired Parameters: reentrant - true if lock levels of the same entity acquired earlier should not restrict compatibility with the lock level desired now Parameters: timeoutMSecs - if blocking is enabled by the wait parameter this specifies the maximum wait time in milliseconds true if the lock actually was acquired throws: InterruptedException - when the thread waiting on this method is interrupted |
getLockLevel | public int getLockLevel(Object ownerId)(Code) | | Retuns the highest lock level the specified owner holds on this lock or 0 if it holds no locks at all.
Parameters: ownerId - a unique id identifying the entity that wants to know its highest lock level the highest lock level |
release | public boolean release(Object ownerId)(Code) | | Releases any lock levels the specified owner may hold on this lock.
Parameters: ownerId - a unique id identifying the entity that wants to release all lock levels true if the lock actually was released, false in casethere was no lock held by the owner |
|
|