org.apache.commons.collections.buffer
Class BlockingBuffer
- Buffer, Collection, Serializable
public class BlockingBuffer
Decorates another
Buffer
to make
get()
and
remove()
block when the
Buffer
is empty.
If either
get
or
remove
is called on an empty
Buffer
, the calling thread waits for notification that
an
add
or
addAll
operation has completed.
When one or more entries are added to an empty
Buffer
,
all threads blocked in
get
or
remove
are notified.
There is no guarantee that concurrent blocked
get
or
remove
requests will be "unblocked" and receive data in the
order that they arrive.
This class is Serializable from Commons Collections 3.1.
Version:
- Stephen Colebourne
- Janek Bogucki
- Phil Steitz
- Commons Collections 3.0
add , addAll , clear , contains , containsAll , decorate , equals , hashCode , isEmpty , iterator , remove , removeAll , retainAll , size , toArray , toArray , toString |
BlockingBuffer
protected BlockingBuffer(Buffer buffer)
Constructor that wraps (not copies).
buffer
- the buffer to decorate, must not be null
decorate
public static Buffer decorate(Buffer buffer)
Factory method to create a blocking buffer.
- decorate in interface SynchronizedBuffer
buffer
- the buffer to decorate, must not be null
- a new blocking Buffer
Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.