|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.libs.QueueBatch
QueueBatch 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.
Nested Class Summary | |
---|---|
class |
QueueBatch.QueueServer
|
Constructor Summary | |
---|---|
QueueBatch()
Constructor for QueueBatch. |
|
QueueBatch(java.lang.String qName)
Constructor for QueueBatch. |
|
QueueBatch(java.lang.String qName,
int threadCount)
Constructor for QueueBatch. |
|
QueueBatch(java.lang.String qName,
int threadCount,
boolean on_demand)
Constructor for QueueBatch. |
|
QueueBatch(java.lang.String qName,
int threadCount,
boolean on_demand,
int idle_time)
Constructor for QueueBatch. |
|
QueueBatch(java.lang.String qName,
int threadCount,
boolean on_demand,
int idle_time,
int threadPriority)
Constructor for QueueBatch. |
Method Summary | |
---|---|
void |
decQueuedCount()
Decrement the queued count with synchronized protection. |
long |
elements()
Return number of elements on queue. |
void |
enqueue(QueueElement element)
This method adds a QueueElement to QueueBatch's queue. |
void |
finalize()
finalize method to clean up when things are done |
long |
getQueuedCount()
Decrement the queued count with synchronized protection. |
int |
getThreadPriority()
Return the current thread priority for all of our threads. |
void |
incQueuedCount()
Increment the queued count with synchronized protection. |
boolean |
remove(QueueElement element)
This method removes the specified QueueElement from the queue. |
void |
setCatchProcessingExceptions(boolean b)
finalize method to clean up when things are done |
void |
setThreadPriority(int priority)
Change the thread priority for all of our threads. |
void |
waitForIdle()
Wait for the queue to be done processing all elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QueueBatch()
public QueueBatch(java.lang.String qName)
qName
- String used to label the single worker thread.public QueueBatch(java.lang.String qName, int threadCount)
qName
- String used to label each worker thread.threadCount
- Number of worker threads to create. One is
substituted if threadCount <= 0.public QueueBatch(java.lang.String qName, int threadCount, boolean on_demand)
qName
- String used to label each worker thread.threadCount
- Number of worker threads to create. One is
substituted if threadCount <= 0.on_demand
- if threads should be created and deleted on demandpublic QueueBatch(java.lang.String qName, int threadCount, boolean on_demand, int idle_time)
qName
- String used to label each worker thread.threadCount
- Number of worker threads to create. One is
substituted if threadCount <= 0.on_demand
- if threads should be created and deleted on demandidle_time
- idle wait time before threads die (msec)public QueueBatch(java.lang.String qName, int threadCount, boolean on_demand, int idle_time, int threadPriority)
qName
- String used to label each worker thread.threadCount
- Number of worker threads to create. One is
substituted if threadCount <= 0.on_demand
- if threads should be created and deleted on demandidle_time
- idle wait time before threads die (msec)threadPriority
- Priority of worker theads.
java.lang.IllegalArgumentException
- If the priority is not in the
range MIN_PRIORITY
to
MAX_PRIORITY
.Method Detail |
public void setCatchProcessingExceptions(boolean b)
public void finalize() throws java.lang.Throwable
java.lang.Throwable
public void enqueue(QueueElement element)
element
- QueueElement object to be added to the queue.public boolean remove(QueueElement element)
element
- QueueElement object to be removed from the queue.
public void incQueuedCount()
public void decQueuedCount()
public long getQueuedCount()
public void waitForIdle()
public void setThreadPriority(int priority)
priority
- Thread priority to set the threads to, between
MIN_PRIORITY and MAX_PRIORITY, inclusively.public int getThreadPriority()
public long elements()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |