com.croftsoft.core.util.queue
Interface QueueRemote

All Superinterfaces:
Remote

public interface QueueRemote
extends Remote

Version:
1998-11-27
Author:
David Wallace Croft

Method Summary
 boolean append(Object o)
          Appends the object to the queue and notifies any threads that are blocked in pull().
 Object poll()
          Poll this queue to see if an object is available, immediately removing one if so.
 Object pull()
          Remove the next object in this queue, blocking until one becomes available.
 Object pull(long timeout)
          Remove the next object in this queue, blocking until one becomes available or the given timeout period expires.
 Object replace(Object o)
          Replaces the first occurrence of any equal object in the queue.
 

Method Detail

append

boolean append(Object o)
               throws RemoteException
Appends the object to the queue and notifies any threads that are blocked in pull().

Returns:
Returns true if the object could be added to the queue.
Throws:
RemoteException

poll

Object poll()
            throws RemoteException
Poll this queue to see if an object is available, immediately removing one if so. If the queue is empty, this method immediately returns null.

Returns:
An object, if one was immediately available, otherwise null.
Throws:
RemoteException

pull

Object pull()
            throws InterruptedException,
                   RemoteException
Remove the next object in this queue, blocking until one becomes available.

Throws:
InterruptedException - If the wait is interrupted.
RemoteException

pull

Object pull(long timeout)
            throws IllegalArgumentException,
                   InterruptedException,
                   RemoteException
Remove the next object in this queue, blocking until one becomes available or the given timeout period expires.

Parameters:
timeout - If positive, block for up to timeout milliseconds while waiting for an object to be added to this queue. If zero, block indefinitely.
Returns:
An object, if one was available within the specified timeout period, otherwise null.
Throws:
IllegalArgumentException - If the value of the timeout argument is negative.
InterruptedException - If the timeout wait is interrupted.
RemoteException

replace

Object replace(Object o)
               throws RemoteException
Replaces the first occurrence of any equal object in the queue. The new object is placed in the same queue order as the old. If the new object is unique, calls add(o).

Returns:
The old object, if available, otherwise null.
Throws:
RemoteException

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)