|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.constructs.nonstop.concurrency.NonstopSync
public class NonstopSync
Class implementing Sync
and that can be executed without getting stuck.
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 | |
---|---|
NonstopSync(NonstopStore nonstopStore,
Sync delegateSync)
Constructor accepting the NonstopStore and the actual Sync |
Method Summary | |
---|---|
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 NonstopSync(NonstopStore nonstopStore, Sync delegateSync)
NonstopStore
and the actual Sync
nonstopStore
- delegateSync
- Method Detail |
---|
public boolean isHeldByCurrentThread(LockType type)
isHeldByCurrentThread
in interface Sync
type
- the lock type to test
public void lock(LockType type)
lock
in interface Sync
type
- the lock type to acquirepublic boolean tryLock(LockType type, long msec) throws InterruptedException
tryLock
in interface Sync
type
- the lock type to acquiremsec
- timeout
InterruptedException
- Should the thread be interruptedpublic void unlock(LockType type)
unlock
in interface Sync
type
- the lock type to acquire
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |