public final class ThreadPoolBuilder extends Object
Constructor and Description |
---|
ThreadPoolBuilder(org.apache.camel.CamelContext context) |
Modifier and Type | Method and Description |
---|---|
ExecutorService |
build()
Builds the new thread pool
|
ExecutorService |
build(Object source,
String name)
Builds the new thread pool
|
ExecutorService |
build(String name)
Builds the new thread pool
|
ScheduledExecutorService |
buildScheduled()
Builds the new scheduled thread pool
|
ScheduledExecutorService |
buildScheduled(Object source,
String name)
Builds the new scheduled thread pool
|
ScheduledExecutorService |
buildScheduled(String name)
Builds the new scheduled thread pool
|
ThreadPoolBuilder |
keepAliveTime(long keepAliveTime) |
ThreadPoolBuilder |
keepAliveTime(long keepAliveTime,
TimeUnit timeUnit) |
ThreadPoolBuilder |
maxPoolSize(int maxPoolSize) |
ThreadPoolBuilder |
maxQueueSize(int maxQueueSize) |
ThreadPoolBuilder |
poolSize(int poolSize) |
ThreadPoolBuilder |
rejectedPolicy(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy) |
public ThreadPoolBuilder(org.apache.camel.CamelContext context)
public ThreadPoolBuilder poolSize(int poolSize)
public ThreadPoolBuilder maxPoolSize(int maxPoolSize)
public ThreadPoolBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit)
public ThreadPoolBuilder keepAliveTime(long keepAliveTime)
public ThreadPoolBuilder maxQueueSize(int maxQueueSize)
public ThreadPoolBuilder rejectedPolicy(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy)
public ExecutorService build() throws Exception
Exception
- is thrown if error building the thread poolpublic ExecutorService build(String name) throws Exception
name
- name which is appended to the thread nameException
- is thrown if error building the thread poolpublic ExecutorService build(Object source, String name) throws Exception
source
- the source object, usually it should be this
passed in as parametername
- name which is appended to the thread nameException
- is thrown if error building the thread poolpublic ScheduledExecutorService buildScheduled() throws Exception
Exception
- is thrown if error building the scheduled thread poolpublic ScheduledExecutorService buildScheduled(String name) throws Exception
name
- name which is appended to the thread nameException
- is thrown if error building the scheduled thread poolpublic ScheduledExecutorService buildScheduled(Object source, String name) throws Exception
source
- the source object, usually it should be this
passed in as parametername
- name which is appended to the thread nameException
- is thrown if error building the scheduled thread poolApache Camel