|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer
org.jboss.cache.util.concurrent.ReclosableLatch
public class ReclosableLatch
This latch allows you to set a default state (open or closed), and repeatedly open or close the latch and have threads wait on it.
This is a better impl of the old org.jboss.cache.util.ThreadGate (which doesn't exist anymore), that uses anAbstractQueuedSynchronizer while ThreadGate used to use explicit Lock
objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer |
|---|
java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject |
| Constructor Summary | |
|---|---|
ReclosableLatch()
|
|
ReclosableLatch(boolean defaultOpen)
|
|
| Method Summary | |
|---|---|
void |
await()
|
boolean |
await(long time,
java.util.concurrent.TimeUnit unit)
|
void |
close()
|
boolean |
isOpen()
|
void |
open()
|
int |
tryAcquireShared(int ignored)
|
boolean |
tryReleaseShared(int state)
|
| Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer |
|---|
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease |
| Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer |
|---|
getExclusiveOwnerThread, setExclusiveOwnerThread |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReclosableLatch()
public ReclosableLatch(boolean defaultOpen)
| Method Detail |
|---|
public final int tryAcquireShared(int ignored)
tryAcquireShared in class java.util.concurrent.locks.AbstractQueuedSynchronizerpublic final boolean tryReleaseShared(int state)
tryReleaseShared in class java.util.concurrent.locks.AbstractQueuedSynchronizerpublic final void open()
public final void close()
public final void await()
throws java.lang.InterruptedException
java.lang.InterruptedException
public final boolean await(long time,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean isOpen()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||