|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A multi level lock. Depending on the implementation more than one owner may own a certain lock level on the same lock.
LockManager
Method Summary | |
boolean |
acquire(java.lang.Object ownerId,
int targetLockLevel,
boolean wait,
boolean reentrant,
long timeoutMSecs)
Tries to acquire a certain lock level on this lock. |
int |
getLockLevel(java.lang.Object ownerId)
Retuns the highest lock level the specified owner holds on this lock or 0 if it holds no locks at all. |
void |
release(java.lang.Object ownerId)
Releases any lock levels the specified owner may hold on this lock. |
Method Detail |
public boolean acquire(java.lang.Object ownerId, int targetLockLevel, boolean wait, boolean reentrant, long timeoutMSecs) throws java.lang.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 milliseconds
true
if the lock actually was acquired
java.lang.InterruptedException
- when the thread waiting on this method is interruptedpublic void release(java.lang.Object ownerId)
ownerId
- a unique id identifying the entity that wants to release all lock levelspublic int getLockLevel(java.lang.Object ownerId)
0
if it holds no locks at all.
ownerId
- a unique id identifying the entity that wants to know its highest lock level
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |