org.apache.camel.builder
Class ThreadPoolBuilder

java.lang.Object
  extended by org.apache.camel.builder.ThreadPoolBuilder

public final class ThreadPoolBuilder
extends java.lang.Object

A builder to create thread pools.

Version:

Constructor Summary
ThreadPoolBuilder(CamelContext camelContext)
           
 
Method Summary
 java.util.concurrent.ExecutorService build(java.lang.Object source, java.lang.String name)
          Builds the new thread pool
 java.util.concurrent.ExecutorService build(java.lang.String name)
          Builds the new thread pool
 ThreadPoolBuilder keepAliveTime(long keepAliveTime)
           
 ThreadPoolBuilder maxPoolSize(int maxPoolSize)
           
 ThreadPoolBuilder maxQueueSize(int maxQueueSize)
           
 ThreadPoolBuilder poolSize(int poolSize)
           
 ThreadPoolBuilder rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
           
 ThreadPoolBuilder timeUnit(java.util.concurrent.TimeUnit timeUnit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPoolBuilder

public ThreadPoolBuilder(CamelContext camelContext)
Method Detail

poolSize

public ThreadPoolBuilder poolSize(int poolSize)

maxPoolSize

public ThreadPoolBuilder maxPoolSize(int maxPoolSize)

keepAliveTime

public ThreadPoolBuilder keepAliveTime(long keepAliveTime)

timeUnit

public ThreadPoolBuilder timeUnit(java.util.concurrent.TimeUnit timeUnit)

maxQueueSize

public ThreadPoolBuilder maxQueueSize(int maxQueueSize)

rejectedPolicy

public ThreadPoolBuilder rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)

build

public java.util.concurrent.ExecutorService build(java.lang.String name)
                                           throws java.lang.Exception
Builds the new thread pool

Parameters:
name - name which is appended to the thread name
Returns:
the created thread pool
Throws:
java.lang.Exception - is thrown if error building the thread pool

build

public java.util.concurrent.ExecutorService build(java.lang.Object source,
                                                  java.lang.String name)
                                           throws java.lang.Exception
Builds the new thread pool

Parameters:
source - the source object, usually it should be this passed in as parameter
name - name which is appended to the thread name
Returns:
the created thread pool
Throws:
java.lang.Exception - is thrown if error building the thread pool


Apache CAMEL