Package org.apache.pekko.util
Class BoundedBlockingQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.apache.pekko.util.BoundedBlockingQueue<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,BlockingQueue<E>,Queue<E>
- Direct Known Subclasses:
BoundedPriorityMailbox.MessageQueue,BoundedStablePriorityMailbox.MessageQueue
BoundedBlockingQueue wraps any Queue and turns the result into a BlockingQueue with a limited capacity.
param: maxCapacity - the maximum capacity of this Queue, needs to be > 0
param: backing - the backing Queue
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanbooleancontainsAll(Collection<?> c) protected ReentrantLockprotected Conditionprotected ConditionintdrainTo(Collection<? super E> c) intdrainTo(Collection<? super E> c, int maxElements) booleanisEmpty()iterator()protected ReentrantLocklock()intprotected ConditionnotEmpty()protected ConditionnotFull()booleanbooleanpeek()poll()voidintbooleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()take()Object[]toArray()<X> X[]toArray(X[] a) Methods inherited from class java.util.AbstractQueue
add, addAll, element, removeMethods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.BlockingQueue
addMethods inherited from interface java.util.Collection
addAll, equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
BoundedBlockingQueue
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Overrides:
clearin classAbstractQueue<E>
-
contains
- Specified by:
containsin interfaceBlockingQueue<E>- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classAbstractCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Overrides:
containsAllin classAbstractCollection<E>
-
createLock
-
createNotEmptyCondition
-
createNotFullCondition
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<E>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
lock
-
maxCapacity
public int maxCapacity() -
notEmpty
-
notFull
-
offer
-
offer
- Specified by:
offerin interfaceBlockingQueue<E>
-
peek
-
poll
- Specified by:
pollin interfaceBlockingQueue<E>
-
poll
-
put
- Specified by:
putin interfaceBlockingQueue<E>
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacityin interfaceBlockingQueue<E>
-
remove
- Specified by:
removein interfaceBlockingQueue<E>- Specified by:
removein interfaceCollection<E>- Overrides:
removein classAbstractCollection<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Overrides:
removeAllin classAbstractCollection<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Overrides:
retainAllin classAbstractCollection<E>
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<E>
-
take
- Specified by:
takein interfaceBlockingQueue<E>
-
toArray
- Specified by:
toArrayin interfaceCollection<E>- Overrides:
toArrayin classAbstractCollection<E>
-
toArray
public <X> X[] toArray(X[] a) - Specified by:
toArrayin interfaceCollection<E>- Overrides:
toArrayin classAbstractCollection<E>
-