org.apache.camel.spi
Interface ThreadPoolFactory

All Known Implementing Classes:
DefaultThreadPoolFactory

public interface ThreadPoolFactory

Creates ExecutorService and ScheduledExecutorService objects that work with a thread pool for a given ThreadPoolProfile and ThreadFactory. This interface allows to customize the creation of these objects to adapt camel for application servers and other environments where thread pools should not be created with the jdk methods


Method Summary
 ExecutorService newCachedThreadPool(ThreadFactory threadFactory)
          Creates a new cached thread pool

The cached thread pool is a term from the JDK from the method Executors.newCachedThreadPool().

 ScheduledExecutorService newScheduledThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory)
          Create a scheduled thread pool using the given thread pool profile
 ExecutorService newThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory)
          Create a thread pool using the given thread pool profile
 

Method Detail

newCachedThreadPool

ExecutorService newCachedThreadPool(ThreadFactory threadFactory)
Creates a new cached thread pool

The cached thread pool is a term from the JDK from the method Executors.newCachedThreadPool(). Typically it will have no size limit (this is why it is handled separately

Parameters:
threadFactory - factory for creating threads
Returns:
the created thread pool

newThreadPool

ExecutorService newThreadPool(ThreadPoolProfile profile,
                              ThreadFactory threadFactory)
Create a thread pool using the given thread pool profile

Parameters:
profile - parameters of the thread pool
threadFactory - factory for creating threads
Returns:
the created thread pool

newScheduledThreadPool

ScheduledExecutorService newScheduledThreadPool(ThreadPoolProfile profile,
                                                ThreadFactory threadFactory)
Create a scheduled thread pool using the given thread pool profile

Parameters:
profile - parameters of the thread pool
threadFactory - factory for creating threads
Returns:
the created thread pool


Apache CAMEL