|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.BlockingQueue
Blocking queue. XXX temp implementation. Should use java2 containers. Implemented as circular buffer in a Vector. Synchronization is on the vector to avoid double synchronization.
Constructor Summary | |
BlockingQueue(int maxSize)
Constructor. |
|
BlockingQueue(java.lang.Object lock,
int maxSize)
Constructor. |
Method Summary | |
void |
clear()
|
java.lang.Object |
get()
Get object from queue. |
java.lang.Object |
get(int timeoutMs)
Get from queue. |
int |
maxSize()
|
java.lang.Object |
peek()
Peek at the queue. |
java.lang.Object |
peek(int timeoutMs)
Peek at the queue. |
void |
put(java.lang.Object o)
Put object in queue. |
void |
put(java.lang.Object o,
int timeout)
Put object in queue. |
int |
size()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlockingQueue(int maxSize)
public BlockingQueue(java.lang.Object lock, int maxSize)
Method Detail |
public void clear()
public int size()
public int maxSize()
public void put(java.lang.Object o) throws java.lang.InterruptedException
o
- Object
java.lang.InterruptedException
public void put(java.lang.Object o, int timeout) throws java.lang.InterruptedException
timeout
- If timeout expires, throw InterruptedExceptiono
- Object
java.lang.InterruptedException
- Timeout expired or otherwise interruptedpublic java.lang.Object get() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object get(int timeoutMs) throws java.lang.InterruptedException
timeoutMs
- the time to wait for a job
java.lang.InterruptedException
public java.lang.Object peek() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object peek(int timeoutMs) throws java.lang.InterruptedException
timeoutMs
- the time to wait for a job
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |