|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LockContainer
A container for locks
| Method Summary | |
|---|---|
Lock |
acquireLock(Object key,
long timeout,
TimeUnit unit)
Attempts to acquire a lock for the given object within certain time boundaries defined by the timeout and time unit parameters. |
Lock |
getLock(Object key)
|
int |
getNumLocksHeld()
|
boolean |
isLocked(Object key)
|
boolean |
ownsLock(Object key,
Object owner)
Tests if a give owner owns a lock on a specified object. |
void |
releaseLock(Object key)
Release lock on the given key. |
int |
size()
|
| Method Detail |
|---|
boolean ownsLock(Object key,
Object owner)
key - object to checkowner - owner to test
boolean isLocked(Object key)
key - object
Lock getLock(Object key)
key - object
int getNumLocksHeld()
int size()
Lock acquireLock(Object key,
long timeout,
TimeUnit unit)
throws InterruptedException
key - Object to acquire lock ontimeout - Time after which the lock acquisition will failunit - Time unit of the given timeout
InterruptedException - If the lock acquisition was interruptedvoid releaseLock(Object key)
key - Object on which lock is to be removed
|
Google Analytics | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||