|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.apache.commons.collections.collection.SynchronizedCollection
|
+--org.apache.commons.collections.buffer.SynchronizedBuffer
|
+--org.apache.commons.collections.buffer.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(java.lang.Object) or addAll(java.util.Collection) 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.
| Method Summary | |
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
static Buffer |
decorate(Buffer buffer)
Factory method to create a blocking buffer. |
java.lang.Object |
get()
Gets the next object from the buffer without removing it. |
java.lang.Object |
remove()
Gets and removes the next object from the buffer. |
| Methods inherited from class org.apache.commons.collections.collection.SynchronizedCollection |
clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Method Detail |
public static Buffer decorate(Buffer buffer)
buffer - the buffer to decorate, must not be null
java.lang.IllegalArgumentException - if buffer is nullpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in class SynchronizedCollectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in class SynchronizedCollectionpublic java.lang.Object get()
Buffer
get in interface Bufferget in class SynchronizedBufferpublic java.lang.Object remove()
Buffer
remove in interface Bufferremove in class SynchronizedBuffer
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||