|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.threadpool.MTQueue
public class MTQueue
A multithreaded blocking queue which is very useful for implementing producer-consumer style threading patterns.
Multiple blocking threads can wait for items being added to the queue while other threads add to the queue.
Non blocking and timout based modes of access are possible as well.
Constructor Summary | |
---|---|
MTQueue()
|
Method Summary | |
---|---|
void |
add(Object object)
adds a new object to the end of the queue. |
Object |
remove()
Removes the first object from the queue, blocking until one is available. |
Object |
remove(long timeout)
Removes the first object from the queue, blocking only up to the given timeout time. |
Object |
removeNoWait()
Removes the first object from the queue without blocking. |
int |
size()
Returns the current number of object in the queue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTQueue()
Method Detail |
---|
public int size()
public void add(Object object)
public Object remove()
public Object remove(long timeout)
public Object removeNoWait()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |