public class RemoteBlockingQueueImpl extends java.rmi.server.UnicastRemoteObject implements RemoteBlockingQueue
RemoteBlockingQueue that uses a
JSR-166 BlockingQueue to do the real work.| 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(java.lang.Object o)
Inserts the specified element into this queue, if
possible.
|
boolean |
offer(java.lang.Object o,
long timeout,
java.util.concurrent.TimeUnit unit)
Inserts the specified element into this queue, waiting if necessary
up to the specified wait time for space to become available.
|
java.lang.Object |
peek()
Retrieves, but does not remove, the head of this queue,
returning null if this queue is empty.
|
java.lang.Object |
poll()
Retrieves and removes the head of this queue.
|
java.lang.Object |
poll(long timeout,
java.util.concurrent.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(java.lang.Object o)
Adds the specified element to this queue, waiting if necessary for
space to become available.
|
java.lang.Object |
take()
Retrieves and removes the head of this queue, waiting
if no elements are present on this queue.
|
clone, exportObject, exportObject, exportObject, unexportObjectpublic RemoteBlockingQueueImpl(int capacity)
throws java.rmi.RemoteException
RemoteBlockingQueueImpl with the given
maximum number of elements.java.rmi.RemoteExceptionpublic boolean offer(java.lang.Object o)
throws java.rmi.RemoteException
RemoteBlockingQueueCollection.add(E), which can fail to insert an element
only by throwing an exception.offer in interface RemoteBlockingQueueo - the element to add.java.rmi.RemoteExceptionpublic boolean offer(java.lang.Object o,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.rmi.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 parameterjava.lang.InterruptedException - if interrupted while waiting.java.rmi.RemoteExceptionpublic java.lang.Object poll(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.rmi.RemoteException
RemoteBlockingQueuepoll in interface RemoteBlockingQueuetimeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterjava.lang.InterruptedException - if interrupted while waiting.java.rmi.RemoteExceptionpublic java.lang.Object poll()
throws java.rmi.RemoteException
RemoteBlockingQueuepoll in interface RemoteBlockingQueuejava.rmi.RemoteExceptionpublic java.lang.Object take()
throws java.lang.InterruptedException,
java.rmi.RemoteException
RemoteBlockingQueuetake in interface RemoteBlockingQueuejava.lang.InterruptedException - if interrupted while waiting.java.rmi.RemoteExceptionpublic void put(java.lang.Object o)
throws java.lang.InterruptedException,
java.rmi.RemoteException
RemoteBlockingQueueput in interface RemoteBlockingQueueo - the element to addjava.lang.InterruptedException - if interrupted while waiting.java.rmi.RemoteExceptionpublic java.lang.Object peek()
throws java.rmi.RemoteException
RemoteBlockingQueuepeek in interface RemoteBlockingQueuejava.rmi.RemoteExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.