Package org.apache.camel.builder
Class ThreadPoolBuilder
- java.lang.Object
-
- org.apache.camel.builder.ThreadPoolBuilder
-
public final class ThreadPoolBuilder extends Object
A builder to create thread pools.
-
-
Constructor Summary
Constructors Constructor Description ThreadPoolBuilder(org.apache.camel.CamelContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServicebuild()Builds the new thread poolExecutorServicebuild(Object source, String name)Builds the new thread poolExecutorServicebuild(String name)Builds the new thread poolScheduledExecutorServicebuildScheduled()Builds the new scheduled thread poolScheduledExecutorServicebuildScheduled(Object source, String name)Builds the new scheduled thread poolScheduledExecutorServicebuildScheduled(String name)Builds the new scheduled thread poolThreadPoolBuilderkeepAliveTime(long keepAliveTime)ThreadPoolBuilderkeepAliveTime(long keepAliveTime, TimeUnit timeUnit)ThreadPoolBuildermaxPoolSize(int maxPoolSize)ThreadPoolBuildermaxQueueSize(int maxQueueSize)ThreadPoolBuilderpoolSize(int poolSize)ThreadPoolBuilderrejectedPolicy(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy)
-
-
-
Constructor Detail
-
ThreadPoolBuilder
public ThreadPoolBuilder(org.apache.camel.CamelContext context)
-
-
Method Detail
-
poolSize
public ThreadPoolBuilder poolSize(int poolSize)
-
maxPoolSize
public ThreadPoolBuilder maxPoolSize(int maxPoolSize)
-
keepAliveTime
public ThreadPoolBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit)
-
keepAliveTime
public ThreadPoolBuilder keepAliveTime(long keepAliveTime)
-
maxQueueSize
public ThreadPoolBuilder maxQueueSize(int maxQueueSize)
-
rejectedPolicy
public ThreadPoolBuilder rejectedPolicy(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy)
-
build
public ExecutorService build() throws Exception
Builds the new thread pool- Returns:
- the created thread pool
- Throws:
Exception- is thrown if error building the thread pool
-
build
public ExecutorService build(String name) throws Exception
Builds the new thread pool- Parameters:
name- name which is appended to the thread name- Returns:
- the created thread pool
- Throws:
Exception- is thrown if error building the thread pool
-
build
public ExecutorService build(Object source, String name) throws Exception
Builds the new thread pool- Parameters:
source- the source object, usually it should be this passed in as parametername- name which is appended to the thread name- Returns:
- the created thread pool
- Throws:
Exception- is thrown if error building the thread pool
-
buildScheduled
public ScheduledExecutorService buildScheduled() throws Exception
Builds the new scheduled thread pool- Returns:
- the created scheduled thread pool
- Throws:
Exception- is thrown if error building the scheduled thread pool
-
buildScheduled
public ScheduledExecutorService buildScheduled(String name) throws Exception
Builds the new scheduled thread pool- Parameters:
name- name which is appended to the thread name- Returns:
- the created scheduled thread pool
- Throws:
Exception- is thrown if error building the scheduled thread pool
-
buildScheduled
public ScheduledExecutorService buildScheduled(Object source, String name) throws Exception
Builds the new scheduled thread pool- Parameters:
source- the source object, usually it should be this passed in as parametername- name which is appended to the thread name- Returns:
- the created scheduled thread pool
- Throws:
Exception- is thrown if error building the scheduled thread pool
-
-