|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.concurrent.ReadWriteLockSync
public class ReadWriteLockSync
A simple ReadWriteLock synchronizer.
| Field Summary |
|---|
| Fields inherited from interface net.sf.ehcache.concurrent.Sync |
|---|
ONE_CENTURY, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR |
| Constructor Summary | |
|---|---|
ReadWriteLockSync()
default constructor. |
|
ReadWriteLockSync(ReentrantReadWriteLock lock)
Constructor. |
|
| Method Summary | |
|---|---|
ReadWriteLock |
getReadWriteLock()
Gets the ReadWriteLock backing this sync. |
boolean |
isHeldByCurrentThread(LockType type)
Returns true is this is lock is held at given level by the current thread. |
void |
lock(LockType type)
Acquire lock of LockType.READ or WRITE |
boolean |
tryLock(LockType type,
long msec)
Tries to acquire a LockType.READ or WRITE for a certain period |
void |
unlock(LockType type)
Releases the lock held by the current Thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReadWriteLockSync()
public ReadWriteLockSync(ReentrantReadWriteLock lock)
lock - | Method Detail |
|---|
public void lock(LockType type)
lock in interface Synctype - the lock type to acquire
public boolean tryLock(LockType type,
long msec)
throws InterruptedException
tryLock in interface Synctype - the lock type to acquiremsec - timeout
InterruptedException - Should the thread be interruptedpublic void unlock(LockType type)
unlock in interface Synctype - the lock type to acquirepublic ReadWriteLock getReadWriteLock()
ReadWriteLock backing this sync.
ReadWriteLockpublic boolean isHeldByCurrentThread(LockType type)
isHeldByCurrentThread in interface Synctype - the lock type to test
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||