|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.BlockingQueue
public class BlockingQueue
This is essentially just a synchronized FIFO queue which blocks input when the queue is full (with a configurable "full" size parameter) and output when the queue is empty. It is useful for exchanging objects between thread which work in some kind of asynchronous pipeline.
| Constructor Summary | |
|---|---|
BlockingQueue()
Constructs a BlockingQueue of unlimited size. |
|
BlockingQueue(int maximumSize)
Constructs a BlockingQueue with the requested size. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object someObject)
Adds an object to the end of the queue. |
void |
close()
Closes the queue. |
void |
closeWhenEmpty()
Closes the queue after it empties. |
int |
getCurrentSize()
Returns the current size. |
java.lang.Object |
remove()
Removes an object from the front of the queue. |
void |
waitUntilEmpty()
Waits for the queue to empty. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockingQueue()
public BlockingQueue(int maximumSize)
| Method Detail |
|---|
public void add(java.lang.Object someObject)
throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object remove()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic int getCurrentSize()
public void waitUntilEmpty()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void closeWhenEmpty()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||