|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.mq.threadpool.ThreadPool
This is an implementation of a simple thread pool with an embedded work queue.
| Constructor Summary | |
ThreadPool(String name,
ThreadGroup threadGroup,
int maxWorkers,
boolean daemon)
Create a new thread pool instance. |
|
| Method Summary | |
void |
cancelWork(Work work)
Cancel a piece of enqueued work. |
void |
enqueueWork(Work work)
Enqueue a piece of work for this thread to handle. |
void |
shutdown()
Shutdown this thread pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ThreadPool(String name, ThreadGroup threadGroup, int maxWorkers, boolean daemon)
threadGroup - The ThreadGroup that worker threads
in this pool should belong to.maxWorkers - The maximum number of worker threads in this pool.daemon - If true, worker threads will be created as
daemon threads.| Method Detail |
public void shutdown()
public void enqueueWork(Work work)
Work.doWork() of the argument.
If the pool is shutting down, this method will not enqueue the
work, but instead simply return.
work - The piece of work to be enqueued.public void cancelWork(Work work)
work - The piece of work to be cancel.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||