|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.edg.data.reptor.test.ThreadPool
ThreadPool implementation that runs a task list.
Method Summary | |
boolean |
addTask(java.lang.Runnable task)
Add a Runnable task to the queue. |
long |
getSLEEP_INTERVAL()
Returns the worker thread sleep interval. |
boolean |
isAwaitingWork()
Whether there are any idle threads in the pool. |
int |
numberCurrentlyRunning()
Return the number of currently running (non-idle) threads. |
int |
numberInQueue()
Return the number of tasks in the queue. |
void |
run()
Method shared by all subthreads. |
void |
setSLEEP_INTERVAL(long SLEEP_INTERVAL)
Sets the worker thread sleep interval. |
void |
shutdown()
Shutdown all the threads. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public int numberCurrentlyRunning()
public int numberInQueue()
public boolean isAwaitingWork()
public boolean addTask(java.lang.Runnable task) throws java.lang.IllegalThreadStateException
Runnable
task to the queue.
task
- The Runnable
task to add.
java.lang.IllegalThreadStateException
- if the pool has been stopped.public void shutdown()
public long getSLEEP_INTERVAL()
public void setSLEEP_INTERVAL(long SLEEP_INTERVAL)
SLEEP_INTERVAL
- (milliseconds)public void run()
Runnable
task on it. Exceptions are logged.
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |