Package org.eclipse.jetty.util
Class BlockingArrayQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.eclipse.jetty.util.BlockingArrayQueue<E>
-
- Type Parameters:
E
- The element type
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,BlockingQueue<E>
,List<E>
,Queue<E>
@Deprecated(since="2021-05-27") public class BlockingArrayQueue<E> extends AbstractList<E> implements BlockingQueue<E>
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A BlockingQueue backed by a circular array capable or growing.This queue is uses a variant of the two lock queue algorithm to provide an efficient queue or list backed by a growable circular array.
Unlike
ArrayBlockingQueue
, this class is able to grow and provides a blocking put call.The queue has both a capacity (the size of the array currently allocated) and a max capacity (the maximum size that may be allocated), which defaults to
Integer.MAX_VALUE
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_CAPACITY
Deprecated.Default initial capacity, 128.static int
DEFAULT_GROWTH
Deprecated.Default growth factor, 64.
-
Constructor Summary
Constructors Constructor Description BlockingArrayQueue()
Deprecated.Creates an unboundedBlockingArrayQueue
with default initial capacity and grow factor.BlockingArrayQueue(int maxCapacity)
Deprecated.Creates a boundedBlockingArrayQueue
that does not grow.BlockingArrayQueue(int capacity, int growBy)
Deprecated.Creates an unboundedBlockingArrayQueue
that grows by the given parameter.BlockingArrayQueue(int capacity, int growBy, int maxCapacity)
Deprecated.Create a boundedBlockingArrayQueue
that grows by the given parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(int index, E e)
Deprecated.boolean
add(E e)
Deprecated.void
clear()
Deprecated.int
drainTo(Collection<? super E> c)
Deprecated.int
drainTo(Collection<? super E> c, int maxElements)
Deprecated.E
element()
Deprecated.E
get(int index)
Deprecated.int
getCapacity()
Deprecated.int
getMaxCapacity()
Deprecated.Iterator<E>
iterator()
Deprecated.ListIterator<E>
listIterator(int index)
Deprecated.boolean
offer(E e)
Deprecated.boolean
offer(E o, long timeout, TimeUnit unit)
Deprecated.E
peek()
Deprecated.E
poll()
Deprecated.E
poll(long time, TimeUnit unit)
Deprecated.void
put(E o)
Deprecated.int
remainingCapacity()
Deprecated.E
remove()
Deprecated.E
remove(int index)
Deprecated.boolean
remove(Object o)
Deprecated.E
set(int index, E e)
Deprecated.int
size()
Deprecated.E
take()
Deprecated.-
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from interface java.util.concurrent.BlockingQueue
contains
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
Deprecated.Default initial capacity, 128.- See Also:
- Constant Field Values
-
DEFAULT_GROWTH
public static final int DEFAULT_GROWTH
Deprecated.Default growth factor, 64.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BlockingArrayQueue
public BlockingArrayQueue()
Deprecated.Creates an unboundedBlockingArrayQueue
with default initial capacity and grow factor.- See Also:
DEFAULT_CAPACITY
,DEFAULT_GROWTH
-
BlockingArrayQueue
public BlockingArrayQueue(int maxCapacity)
Deprecated.Creates a boundedBlockingArrayQueue
that does not grow. The capacity of the queue is fixed and equal to the given parameter.- Parameters:
maxCapacity
- the maximum capacity
-
BlockingArrayQueue
public BlockingArrayQueue(int capacity, int growBy)
Deprecated.Creates an unboundedBlockingArrayQueue
that grows by the given parameter.- Parameters:
capacity
- the initial capacitygrowBy
- the growth factor
-
BlockingArrayQueue
public BlockingArrayQueue(int capacity, int growBy, int maxCapacity)
Deprecated.Create a boundedBlockingArrayQueue
that grows by the given parameter.- Parameters:
capacity
- the initial capacitygrowBy
- the growth factormaxCapacity
- the maximum capacity
-
-
Method Detail
-
clear
public void clear()
Deprecated.- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
- Overrides:
clear
in classAbstractList<E>
-
size
public int size()
Deprecated.- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
offer
public boolean offer(E e)
Deprecated.
-
add
public boolean add(E e)
Deprecated.- Specified by:
add
in interfaceBlockingQueue<E>
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceList<E>
- Specified by:
add
in interfaceQueue<E>
- Overrides:
add
in classAbstractList<E>
-
put
public void put(E o) throws InterruptedException
Deprecated.- Specified by:
put
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
offer
public boolean offer(E o, long timeout, TimeUnit unit) throws InterruptedException
Deprecated.- Specified by:
offer
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
take
public E take() throws InterruptedException
Deprecated.- Specified by:
take
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
poll
public E poll(long time, TimeUnit unit) throws InterruptedException
Deprecated.- Specified by:
poll
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
remove
public boolean remove(Object o)
Deprecated.- Specified by:
remove
in interfaceBlockingQueue<E>
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceList<E>
- Overrides:
remove
in classAbstractCollection<E>
-
remainingCapacity
public int remainingCapacity()
Deprecated.- Specified by:
remainingCapacity
in interfaceBlockingQueue<E>
-
drainTo
public int drainTo(Collection<? super E> c)
Deprecated.- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
drainTo
public int drainTo(Collection<? super E> c, int maxElements)
Deprecated.- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
get
public E get(int index)
Deprecated.
-
add
public void add(int index, E e)
Deprecated.
-
remove
public E remove(int index)
Deprecated.
-
listIterator
public ListIterator<E> listIterator(int index)
Deprecated.- Specified by:
listIterator
in interfaceList<E>
- Overrides:
listIterator
in classAbstractList<E>
-
getCapacity
public int getCapacity()
Deprecated.- Returns:
- the current capacity of this queue
-
getMaxCapacity
public int getMaxCapacity()
Deprecated.- Returns:
- the max capacity of this queue, or -1 if this queue is unbounded
-
-