# Class RxTaskPool

java.lang.Object
org.apache.catalina.tribes.transport.RxTaskPool

public class RxTaskPool extends Object
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

Nested Classes
Modifier and Type
Class
Description
`static interface`
`RxTaskPool.TaskCreator`

## Constructor Summary

Constructors
Constructor
Description
`RxTaskPool(int maxTasks, int minTasks, RxTaskPool.TaskCreator creator)`

## Method Summary

Modifier and Type
Method
Description
`int`
`available()`
`protected void`
`configureTask(AbstractRxTask task)`
`int`
`getMaxThreads()`
`int`
`getMinThreads()`
`AbstractRxTask`
`getRxTask()`
Find an idle worker thread, if any.
`RxTaskPool.TaskCreator`
`getTaskCreator()`
`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()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RxTaskPool

public RxTaskPool(int maxTasks, int minTasks, RxTaskPool.TaskCreator creator) throws Exception

Throws:
  `Exception`

## Method Details

### configureTask

protected void configureTask(AbstractRxTask task)

### getRxTask

public AbstractRxTask getRxTask()
Find an idle worker thread, if any. Could return null.

Returns:
  a worker

### available

public int available()

### returnWorker

public void returnWorker(AbstractRxTask worker)
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

public RxTaskPool.TaskCreator getTaskCreator()