public class PollablePriorityDelayQueue<E> extends PriorityDelayQueue<E>
PriorityDelayQueue.QueueElement<E>
ANTI_STARVATION_INTERVAL, currentSize, lock, priorities, queues
Constructor and Description |
---|
PollablePriorityDelayQueue(int priorities,
long maxWait,
TimeUnit unit,
int maxSize) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
eligibleToPoll(PriorityDelayQueue.QueueElement<?> element)
Method for checking the QueueElement eligible to poll before remove it from queue.
|
PriorityDelayQueue.QueueElement<E> |
poll()
Retrieve and remove the head of this queue if it is eligible to poll.
|
add, antiStarvation, clear, debug, drainTo, drainTo, getMaxSize, getMaxWait, getPriorities, iterator, offer, offer, peek, poll, put, remainingCapacity, size, sizes, take
addAll, element, remove
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, remove
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public PollablePriorityDelayQueue(int priorities, long maxWait, TimeUnit unit, int maxSize)
public PriorityDelayQueue.QueueElement<E> poll()
Invocations to this method run the anti-starvation (once every interval check).
poll
in interface Queue<PriorityDelayQueue.QueueElement<E>>
poll
in class PriorityDelayQueue<E>
protected boolean eligibleToPoll(PriorityDelayQueue.QueueElement<?> element)
This method should be overriden for checking purposes.
element
- the element to checkCopyright © 2018 Apache Software Foundation. All rights reserved.