public interface MultiLevelLock
LockManager
Modifier and Type | Method and Description |
---|---|
boolean |
acquire(Object ownerId,
int targetLockLevel,
boolean wait,
boolean reentrant,
long timeoutMSecs)
Tries to acquire a certain lock level on this lock.
|
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. |
boolean |
release(Object ownerId)
Releases any lock levels the specified owner may hold on this lock.
|
boolean acquire(Object ownerId, int targetLockLevel, boolean wait, boolean reentrant, long timeoutMSecs) throws InterruptedException
ownerId
- a unique id identifying the entity that wants to acquire a certain lock level on this locktargetLockLevel
- the lock level to acquirewait
- true
if this method shall block when the desired lock level can not be acquiredreentrant
- true
if lock levels of the same entity acquired earlier
should not restrict compatibility with the lock level desired nowtimeoutMSecs
- if blocking is enabled by the wait
parameter this specifies the maximum wait time in millisecondstrue
if the lock actually was acquiredInterruptedException
- when the thread waiting on this method is interruptedboolean release(Object ownerId)
ownerId
- a unique id identifying the entity that wants to release all lock levelstrue
if the lock actually was released, false
in case
there was no lock held by the ownerint getLockLevel(Object ownerId)
0
if it holds no locks at all.ownerId
- a unique id identifying the entity that wants to know its highest lock levelCopyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.