public class BlockingQueue
extends java.lang.Object
| Constructor and Description |
|---|
BlockingQueue(int maxSize)
Constructor.
|
BlockingQueue(java.lang.Object lock,
int maxSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
public BlockingQueue(int maxSize)
public BlockingQueue(java.lang.Object lock,
int maxSize)
public void clear()
public int size()
public int maxSize()
public void put(java.lang.Object o)
throws java.lang.InterruptedException
o - Objectjava.lang.InterruptedExceptionpublic void put(java.lang.Object o,
int timeout)
throws java.lang.InterruptedException
timeout - If timeout expires, throw InterruptedExceptiono - Objectjava.lang.InterruptedException - Timeout expired or otherwise interruptedpublic java.lang.Object get()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.Object get(int timeoutMs)
throws java.lang.InterruptedException
timeoutMs - the time to wait for a jobjava.lang.InterruptedExceptionpublic java.lang.Object peek()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.Object peek(int timeoutMs)
throws java.lang.InterruptedException
timeoutMs - the time to wait for a jobjava.lang.InterruptedExceptionCopyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.