com.ibm.ras
Interface RASIQueue

All Known Implementing Classes:
RASCircularQueue, RASQueue

public interface RASIQueue

The RASIQueue interface describes those methods which must be implemented in order to be a queue for RAS events.

See Also:
RASQueue, RASCircularQueue

Method Summary
 java.lang.Object dequeue()
          Removes an object from the queue.
 void enqueue(java.lang.Object object)
          Adds an object to the queue.
 java.lang.Object firstObject()
          Returns the first object on the queue, but does not remove it from the queue.
 int getMaximumQueueSize()
          Gets the maximum number of objects which this queue will hold.
 int getQueueSize()
          Gets the current number of objects in this queue.
 boolean isCircular()
          Determines if the queue is circular.
 boolean isEmpty()
          Determines if the queue is empty.
 boolean isFull()
          Determines if the queue is full.
 void requeue(java.lang.Object object)
          Returns an object to the front of the queue.
 

Method Detail

getQueueSize

public int getQueueSize()
Gets the current number of objects in this queue.

Returns:
The current queue size.

getMaximumQueueSize

public int getMaximumQueueSize()
Gets the maximum number of objects which this queue will hold. If this maximum is exceeded, new events will be discarded. If not set, the default value of 10,000 is returned.

Returns:
The maximum queue size.

isEmpty

public boolean isEmpty()
Determines if the queue is empty.

Returns:
true if the queue is empty or false otherwise.

isFull

public boolean isFull()
Determines if the queue is full.

Returns:
true if the queue is full or false otherwise.

isCircular

public boolean isCircular()
Determines if the queue is circular. A circular queue always accepts new objects. If all slots are full, a new object replaces the oldest object in the queue.

Returns:
true if this queue is circular, or false otherwise.

enqueue

public void enqueue(java.lang.Object object)
             throws RASQueueFullException
Adds an object to the queue. If the object is null, nothing is enqueued.

Parameters:
object - The object to be placed on the queue.
Throws:
RASQueueFullException - This exception is thrown if the queue is full.

dequeue

public java.lang.Object dequeue()
                         throws RASQueueEmptyException
Removes an object from the queue.

Returns:
The first object in the queue.
Throws:
RASQueueEmptyException - This exception is thrown if the queue is empty.

requeue

public void requeue(java.lang.Object object)
Returns an object to the front of the queue. If the object is null, nothing is enqueued.

Parameters:
object - The object to be placed on the queue.

firstObject

public java.lang.Object firstObject()
                             throws RASQueueEmptyException
Returns the first object on the queue, but does not remove it from the queue.

Returns:
The first object in the queue.
Throws:
RASQueueEmptyException - This exception is thrown if the queue is empty.


 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.