public class RemoteBlockingQueueImpl extends UnicastRemoteObject implements RemoteBlockingQueue
RemoteBlockingQueue that uses a
JSR-166 BlockingQueue to do the real work.ref| Constructor and Description |
|---|
RemoteBlockingQueueImpl(int capacity)
Creates a new
RemoteBlockingQueueImpl with the given
maximum number of elements. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
offer(Object o)
Inserts the specified element into this queue, if
possible.
|
boolean |
offer(Object o,
long timeout,
TimeUnit unit)
Inserts the specified element into this queue, waiting if necessary
up to the specified wait time for space to become available.
|
Object |
peek()
Retrieves, but does not remove, the head of this queue,
returning null if this queue is empty.
|
Object |
poll()
Retrieves and removes the head of this queue.
|
Object |
poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue, waiting
if necessary up to the specified wait time if no elements are
present on this queue.
|
void |
put(Object o)
Adds the specified element to this queue, waiting if necessary for
space to become available.
|
Object |
take()
Retrieves and removes the head of this queue, waiting
if no elements are present on this queue.
|
clone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogpublic RemoteBlockingQueueImpl(int capacity)
throws RemoteException
RemoteBlockingQueueImpl with the given
maximum number of elements.RemoteExceptionpublic boolean offer(Object o) throws RemoteException
RemoteBlockingQueueCollection.add(E), which can fail to insert an element
only by throwing an exception.offer in interface RemoteBlockingQueueo - the element to add.RemoteExceptionpublic boolean offer(Object o, long timeout, TimeUnit unit) throws InterruptedException, RemoteException
RemoteBlockingQueueoffer in interface RemoteBlockingQueueo - the element to addtimeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterInterruptedException - if interrupted while waiting.RemoteExceptionpublic Object poll(long timeout, TimeUnit unit) throws InterruptedException, RemoteException
RemoteBlockingQueuepoll in interface RemoteBlockingQueuetimeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterInterruptedException - if interrupted while waiting.RemoteExceptionpublic Object poll() throws RemoteException
RemoteBlockingQueuepoll in interface RemoteBlockingQueueRemoteExceptionpublic Object take() throws InterruptedException, RemoteException
RemoteBlockingQueuetake in interface RemoteBlockingQueueInterruptedException - if interrupted while waiting.RemoteExceptionpublic void put(Object o) throws InterruptedException, RemoteException
RemoteBlockingQueueput in interface RemoteBlockingQueueo - the element to addInterruptedException - if interrupted while waiting.RemoteExceptionpublic Object peek() throws RemoteException
RemoteBlockingQueuepeek in interface RemoteBlockingQueueRemoteExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.