|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.libs.QueueTimer
QueueTimer is a class that allows objects that have implemented the "QueueElement" interface to be enqueued based on the time of day. Items on the queue will be "run" when the process's time of day has passed the time of day marked in the enqueued element. The enqueued element must implement a "process" method as described by the "QueueElement" interface. A QueueTimer instance can be constructed with one or more worker threads. The default constructor will create one worker thread.
Constructor Summary | |
---|---|
QueueTimer()
Constructor for QueueTimer. |
|
QueueTimer(java.lang.String qName)
Constructor for QueueTimer. |
|
QueueTimer(java.lang.String qName,
int threadCount)
Constructor for QueueTimer. |
Method Summary | |
---|---|
void |
enqueue(QueueElement element,
java.util.Date tod)
This method adds a QueueElement to QueueTimer's queue. |
void |
enqueue(QueueElement element,
long tod)
This method adds a QueueElement to QueueTimer's queue. |
void |
enqueue(QueueElement element,
long tod,
boolean realTime)
This method adds a QueueElement to QueueTimer's queue. |
void |
finalize()
finalize method to clean up when things are done |
boolean |
remove(QueueElement element)
This method removes a QueueElement from the QueueTimer's queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QueueTimer()
public QueueTimer(java.lang.String qName)
public QueueTimer(java.lang.String qName, int threadCount)
Method Detail |
public void finalize() throws java.lang.Throwable
java.lang.Throwable
public void enqueue(QueueElement element, long tod, boolean realTime)
element
- QueueElement object to be added to the queue.tod
- The time/date of day when the element's "process" method is
to be called.realTime
- TRUE : specified time is actual time/date in mSec
the element is to be processed. FALSE: the specified
time is the number of mSec from the current time
the element is to be processed.public void enqueue(QueueElement element, java.util.Date tod)
element
- QueueElement object to be added to the queue.tod
- Date object representing absolute time/date the element
is to be popped.public void enqueue(QueueElement element, long tod)
element
- QueueElement object to be added to the queue.tod
- The time/date of day when the element's "process" method is
to be called.public boolean remove(QueueElement element)
element
- QueueElement object to be removed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |