public class ThreadPoolHolder extends Object
Constructor and Description |
---|
ThreadPoolHolder(int[] poolSizes)
Instantiates the thread pools.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(int num,
Runnable task)
Executes a task in the specified thread pool
|
<T> Future<T> |
submit(int num,
Callable<T> task)
Submits a task to the specified thread pool
|
public ThreadPoolHolder(int[] poolSizes)
public <T> Future<T> submit(int num, Callable<T> task)
num
- thread pool indextask
- to be submittedpublic void execute(int num, Runnable task)
num
- thread pool indextask
- to be executed