java.lang.Object | +--org.apache.commons.collections.collection.SynchronizedCollection | +--org.apache.commons.collections.buffer.SynchronizedBuffer | +--org.apache.commons.collections.buffer.BlockingBuffer
BlockingBuffer(Buffer buffer) Constructor that wraps (not copies). |
boolean | add(Object o) |
boolean | addAll(Collection c) |
static Buffer | Factory method to create a blocking buffer. |
Object | get() |
Object | remove() |
protected BlockingBuffer(Buffer buffer)
- if the buffer is nullpublic boolean add(Object o)
public boolean addAll(Collection c)
public static Buffer decorate(Buffer buffer)
- if buffer is nullpublic Object get()
public Object remove()
Buffer
to make get() and remove() block when theBuffer
is empty. If eitherget
orremove
is called on an emptyBuffer
, the calling thread waits for notification that an add or addAll operation has completed. When one or more entries are added to an emptyBuffer
, all threads blocked inget
orremove
are notified. There is no guarantee that concurrent blockedget
orremove
requests will be "unblocked" and receive data in the order that they arrive.