| java.lang.Object biz.hammurapi.config.ComponentBase biz.hammurapi.util.ThreadPool
ThreadPool | public class ThreadPool extends ComponentBase implements Worker(Code) | | Distributes work among multiple threads.
author: Pavel Vlasov |
Constructor Summary | |
public | ThreadPool() | public | ThreadPool(int numberOfThreads, int priority, int maxQueue, ExceptionSink exceptionSink) Parameters: numberOfThreads - Number of threads to create. Parameters: priority - Threads priority. Parameters: maxQueue - Maximum number of jobs in execution queue. | public | ThreadPool(int numberOfThreads, int priority, int maxQueue, ExceptionSink exceptionSink, String name) |
ThreadPool | public ThreadPool()(Code) | | |
ThreadPool | public ThreadPool(int numberOfThreads, int priority, int maxQueue, ExceptionSink exceptionSink)(Code) | | Parameters: numberOfThreads - Number of threads to create. Parameters: priority - Threads priority. Parameters: maxQueue - Maximum number of jobs in execution queue. When execution queue reaches its maximum post() processes job in the invoking thread. Values <1 mean no limit. Parameters: exceptionSink - |
getMaxQueue | public int getMaxQueue()(Code) | | |
getNumberOfThreads | public int getNumberOfThreads()(Code) | | |
getPriority | public int getPriority()(Code) | | |
replenish | public void replenish()(Code) | | Creates threads to replace terminated threads.
Client posting jobs to thread pool may implement liveness check routines and
terminate pool threads in a job hangs. This method allows the client code
to replenish the thread pool after termination of one of worker threads.
|
setMaxQueue | public void setMaxQueue(int maxQueue)(Code) | | |
setNumberOfThreads | public void setNumberOfThreads(int numberOfThreads)(Code) | | |
setPriority | public void setPriority(int priority)(Code) | | |
|
|