com.tivoli.twg.engine
Class TWGQueueBatch

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGQueueBatch
All Implemented Interfaces:
java.lang.Runnable

public class TWGQueueBatch
extends java.lang.Object
implements java.lang.Runnable

TWGTimerBatch is a class that allows sub-classed objects to be enqueued and executed on the "batch" thread. Jobs related to enqueued elements do not have to be sub-second runs. Because of this allowance, there is no guraantee of estimated time of execution. The queue is a simple FIFO. When a queue element is dequeued, the sub-class's "process" method is called.


Field Summary
protected  java.lang.Thread myThread
           
 
Method Summary
static void enqueue(TWGQueueElement element)
          This method adds a TWGQueueElement to TWGQueueBatch's queue.
 void run()
          Our thread's entry point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myThread

protected java.lang.Thread myThread
Method Detail

enqueue

public static void enqueue(TWGQueueElement element)
This method adds a TWGQueueElement to TWGQueueBatch's queue. The new element is placed in the queue in FIFO order.

Parameters:
element - TWGQueueElement object to be added to the queue.

run

public void run()
Our thread's entry point. This method will remove and process all enqueued elements. As elements are removed, their "process" methods are called. When the queue becomes empty, this thread sleeps indefinately until an element is enqueued.

Specified by:
run in interface java.lang.Runnable