Class RxTaskPool
java.lang.Object
org.apache.catalina.tribes.transport.RxTaskPool
A very simple thread pool class. The pool size is set at construction time and remains fixed. Threads are cycled
through a FIFO idle queue.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
protected void
configureTask
(AbstractRxTask task) int
int
Find an idle worker thread, if any.void
returnWorker
(AbstractRxTask worker) Called by the worker thread to return itself to the idle pool.void
setMaxTasks
(int maxThreads) void
setMinTasks
(int minThreads) void
stop()
-
Constructor Details
-
RxTaskPool
- Throws:
Exception
-
-
Method Details
-
configureTask
-
getRxTask
Find an idle worker thread, if any. Could return null.- Returns:
- a worker
-
available
public int available() -
returnWorker
Called by the worker thread to return itself to the idle pool.- Parameters:
worker
- The worker
-
getMaxThreads
public int getMaxThreads() -
getMinThreads
public int getMinThreads() -
stop
public void stop() -
setMaxTasks
public void setMaxTasks(int maxThreads) -
setMinTasks
public void setMinTasks(int minThreads) -
getTaskCreator
-