IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.kernel.engine
Interface IQueue

All Superinterfaces:
IControllable, ICountable
All Known Subinterfaces:
IActionQueue

public interface IQueue
extends IControllable, ICountable


Method Summary
 Object dequeue()
          Retrieve the next Object from this queue.
 Object dequeue(long waitTime)
          Retrieve the next Object from this queue, with timeout value.
 void enqueue(Object object)
          Place an object into this queue.
 long getAverageTimeInQueue()
           
 long getDequeueAverage()
           
 long getDequeueRequests()
           
 long getEnqueueAverage()
           
 long getEnqueueRequests()
           
 Object getNotifier()
           
 boolean isEmpty()
           
 void resetAverages()
          Reset the counters that measure averages.
 void setBlocking(boolean blocking)
          Changes whether or not the queue should block on dequeues.
 int size()
          Get the number of items in the queue.
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.engine.IControllable
drain, isPaused, isRunning, pause, resume, shutdown
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.ICountable
addCounter, getCounter, getCounters, resetCounters
 

Method Detail

enqueue

void enqueue(Object object)
Place an object into this queue.

Parameters:
object - action to add to queue
Throws:
QueueException - if the queue is not operational

dequeue

Object dequeue()
Retrieve the next Object from this queue.

Note: If the queue has been set to blocking mode, the method should not normally return until there is data available. If the 'wait' was interrupted for some reason, this method may return null even in blocking mode. Please check for this condition.

Returns:
the next Object or null if no data is available
Throws:
QueueException - if the queue is not operational

dequeue

Object dequeue(long waitTime)
Retrieve the next Object from this queue, with timeout value.

Returns:
the next Object or null if no data is available
Throws:
QueueException - if the queue is not operational

setBlocking

void setBlocking(boolean blocking)
Changes whether or not the queue should block on dequeues.

Default behavior is non-blocking.

Parameters:
blocking - 'true' if the queue should block

size

int size()
Get the number of items in the queue.

Returns:
the count
Throws:
QueueException - if the queue is not operational

isEmpty

boolean isEmpty()

getEnqueueRequests

long getEnqueueRequests()
Returns:
the total number of enqueues since startup

getDequeueRequests

long getDequeueRequests()
Returns:
the total number of enqueues since startup

getEnqueueAverage

long getEnqueueAverage()
Returns:
the total number of enqueues since startup (or reset)

getDequeueAverage

long getDequeueAverage()
Returns:
the average dequeue rate since startup (or reset)

getAverageTimeInQueue

long getAverageTimeInQueue()
Returns:
the average time an object has spent in this queue since startup (or reset)

resetAverages

void resetAverages()
Reset the counters that measure averages.

See Also:
IQueue.getAverageTimeInQueue(), IQueue.getDequeueAverage(), IQueue.getDequeueRequests(), IQueue.getEnqueueAverage(), IQueue.getEnqueueRequests()

getNotifier

Object getNotifier()

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.