org.apache.qpid.util.concurrent
Class SynchBuffer<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.apache.qpid.util.concurrent.BatchSynchQueueBase<E>
org.apache.qpid.util.concurrent.SynchBuffer<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>, BatchSynchQueue<E>
public class SynchBuffer<E>
- extends BatchSynchQueueBase<E>
SynchBuffer completes the BatchSynchQueueBase
abstract class by providing an implementation of the underlying
queue as an array. This uses FIFO ordering for the queue but restricts the maximum size of the queue to a fixed
amount. It also has the advantage that, as the buffer does not grow and shrink dynamically, memory for the buffer
is allocated up front and does not create garbage during the operation of the queue.
CRC Card
Responsibilities | Collaborations
|
---|
Provide array based FIFO queue to create a batch synched queue around.
|
- Todo:
- Write an array based buffer implementation that implements Queue.
Method Summary |
protected
|
createQueue()
Returns an empty queue, implemented as an array. |
Methods inherited from class org.apache.qpid.util.concurrent.BatchSynchQueueBase |
drainTo, drainTo, drainTo, drainTo, extract, getBufferCapacity, insert, iterator, offer, offer, peek, peekAtBufferHead, poll, poll, put, remainingCapacity, size, take, tryPut |
SynchBuffer
public SynchBuffer()
createQueue
protected <T> Queue<T> createQueue()
- Returns an empty queue, implemented as an array.
- Specified by:
createQueue
in class BatchSynchQueueBase<E>
- Returns:
- An empty queue, implemented as an array.
Licensed to the Apache Software Foundation