E
- the type of entry in this EventQueuepublic class EventQueue<E>
extends java.util.concurrent.LinkedBlockingQueue<E>
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.locks.Condition |
countReached |
static boolean |
DEBUG |
private static long |
DEBUG_START |
private int |
goalCount |
private java.util.concurrent.locks.ReentrantLock |
lock |
Constructor and Description |
---|
EventQueue() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
void |
awaitEventCount(int expectedEventCount,
int timeoutDuration,
java.util.concurrent.TimeUnit timeoutUnit)
Await a specific event count
|
private void |
debug(java.lang.String format,
java.lang.Object... args) |
private boolean |
goalCheck() |
boolean |
offer(E o) |
void |
shutdown()
Shutdown the queue.
|
clear, contains, drainTo, drainTo, iterator, offer, peek, poll, poll, put, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toString
containsAll, isEmpty, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final boolean DEBUG
private static final long DEBUG_START
private final java.util.concurrent.locks.ReentrantLock lock
private final java.util.concurrent.locks.Condition countReached
private int goalCount
public boolean add(E o)
public void awaitEventCount(int expectedEventCount, int timeoutDuration, java.util.concurrent.TimeUnit timeoutUnit) throws java.util.concurrent.TimeoutException, java.lang.InterruptedException
expectedEventCount
- the number of events to wait fortimeoutDuration
- the timeout durationtimeoutUnit
- the timeout unitjava.util.concurrent.TimeoutException
- if timeout while waiting for the event countjava.lang.InterruptedException
- if await was interruptedprivate void debug(java.lang.String format, java.lang.Object... args)
private boolean goalCheck()
public boolean offer(E o)
public void shutdown()