|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.manager.lock.ReentrantLockFactory
public class ReentrantLockFactory
A lock factory that creates a new instance of ReentrantLock
on each call to getLock(String)
.
Constructor Summary | |
---|---|
ReentrantLockFactory()
|
Method Summary | |
---|---|
java.util.concurrent.locks.Lock |
getLock(java.lang.String key)
Get the lock for the specified key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReentrantLockFactory()
Method Detail |
---|
public java.util.concurrent.locks.Lock getLock(java.lang.String key)
LockFactory
Lock l = lockFactory.getLock("mylock");
l.lock();
try {
// access the resource protected by this lock
} finally {
l.unlock();
}
getLock
in interface LockFactory
key
- the key for this lock
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |