com.ibm.ras
Class RASCircularQueue
- java.lang.Object
-
- com.ibm.ras.RASCircularQueue
-
- All Implemented Interfaces:
- RASIQueue
Deprecated.As of WAS 6.0, recommend using java.util.logging
public class RASCircularQueue extends java.lang.Object implements RASIQueue
RASCircularQueueis a circular queue for RAS events. When the queue fills, the next RAS event replaces the oldest event already in the queue.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULT_QUEUE_SIZEDeprecated.The default queue size (10,000).
-
Constructor Summary
Constructors Constructor and Description RASCircularQueue()Deprecated.Creates aRASCircularQueue, whose size is defined byDEFAULT_QUEUE_SIZE.RASCircularQueue(int size)Deprecated.Creates aRASCircularQueue.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.Objectdequeue()Deprecated.Removes an object from the beginning of the queue.voidenqueue(java.lang.Object object)Deprecated.Adds an object to the end of the queue.java.lang.ObjectfirstObject()Deprecated.Returns the first object on the queue, but does not remove it from the queue.intgetMaximumQueueSize()Deprecated.Gets the maximum number of objects which this queue will hold.intgetQueueSize()Deprecated.Gets the current number of objects in this queue.booleanisCircular()Deprecated.Determines if the queue is circular.booleanisEmpty()Deprecated.Determines if the queue is empty.booleanisFull()Deprecated.Determines if the queue is full.voidrequeue(java.lang.Object object)Deprecated.Returns an object to the front of the queue.
-
-
-
Field Detail
-
DEFAULT_QUEUE_SIZE
public static final int DEFAULT_QUEUE_SIZE
Deprecated.The default queue size (10,000).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RASCircularQueue
public RASCircularQueue()
Deprecated.Creates aRASCircularQueue, whose size is defined byDEFAULT_QUEUE_SIZE.
-
RASCircularQueue
public RASCircularQueue(int size) throws java.lang.IllegalArgumentExceptionDeprecated.Creates aRASCircularQueue.- Parameters:
size- The number of objects that this queue can hold. If the size is zero, the queue size is set toDEFAULT_QUEUE_SIZE.- Throws:
java.lang.IllegalArgumentException- This exception is thrown if the size parameter is less than zero.
-
-
Method Detail
-
getQueueSize
public int getQueueSize()
Deprecated.Gets the current number of objects in this queue.- Specified by:
getQueueSizein interfaceRASIQueue- Returns:
- The current queue size.
-
getMaximumQueueSize
public int getMaximumQueueSize()
Deprecated.Gets the maximum number of objects which this queue will hold.- Specified by:
getMaximumQueueSizein interfaceRASIQueue- Returns:
- The maximum queue size.
-
isEmpty
public boolean isEmpty()
Deprecated.Determines if the queue is empty.
-
isFull
public boolean isFull()
Deprecated.Determines if the queue is full.
-
isCircular
public boolean isCircular()
Deprecated.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.- Specified by:
isCircularin interfaceRASIQueue- Returns:
trueif this queue is circular, orfalseotherwise. (This queue always returnstrue.)
-
enqueue
public void enqueue(java.lang.Object object) throws RASQueueFullExceptionDeprecated.Adds an object to the end of the queue. If the object isnull, nothing is enqueued.- Specified by:
enqueuein interfaceRASIQueue- 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 RASQueueEmptyExceptionDeprecated.Removes an object from the beginning of the queue.- Specified by:
dequeuein interfaceRASIQueue- 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) throws java.lang.IllegalStateExceptionDeprecated.Returns an object to the front of the queue. If the object isnull, nothing is enqueued.- Specified by:
requeuein interfaceRASIQueue- Parameters:
object- The object to be placed on the queue.- Throws:
java.lang.IllegalStateException- This exception is always thrown because there is no way to reliably add an object to the beginning of a circular queue if objects are added and removed viaenqueueanddequeue. SeeRASQueue.requeue.
-
firstObject
public java.lang.Object firstObject() throws RASQueueEmptyExceptionDeprecated.Returns the first object on the queue, but does not remove it from the queue.- Specified by:
firstObjectin interfaceRASIQueue- Returns:
- The first object in the queue.
- Throws:
RASQueueEmptyException- This exception is thrown if the queue is empty.
-
-