public class MultiQueueWithTopicThreadPool extends Object
| Constructor and Description |
|---|
MultiQueueWithTopicThreadPool(int poolSize,
int capacity,
String namePrefix) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Object topic,
Runnable runnable)
add the runnable into corresponding queue and it when it reach to the head of queue the queue is decided based on
topic. |
void |
shutdown() |
public MultiQueueWithTopicThreadPool(int poolSize,
int capacity,
String namePrefix)
public void execute(Object topic, Runnable runnable) throws IllegalStateException
topic. if topic is instance of Integer, it uses (topic%poolSize) to determine corresponding queue
otherwise it uses (topic.hashCode()%poolsize) do determine corresponding queue.topic - tasks are organized between threads based on this parameterrunnable - the task that should be executedIllegalStateException - if the runnable cannot be added at this time due to queue capacity
restrictionspublic void shutdown()
Apache Camel