public class ThreadPool
extends java.lang.Object
Constructor and Description |
---|
ThreadPool(int size,
LoggerIfc logger) |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createId()
create's an ID for the worker threads
|
void |
performTask(PoolTask task)
ask the pool to perform a task.
|
void |
shutdown()
Stop all threads.
|
boolean |
taskCompleted(com.nt.udc.util.threadpool.Worker w)
worker threads should call this methods after it has completed its task.
|
public ThreadPool(int size, LoggerIfc logger)
size
- number of threads in this poollogger
- log messages to thispublic void performTask(PoolTask task) throws ThreadPoolException
task
- ThreadPoolException
- if the thread pool has shutdownpublic void shutdown()
public static java.lang.String createId()
public boolean taskCompleted(com.nt.udc.util.threadpool.Worker w)