Package org.apache.camel.spi
Interface ThreadPoolFactory
-
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutorService
newCachedThreadPool(ThreadFactory threadFactory)
Creates a new cached thread poolScheduledExecutorService
newScheduledThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory)
Create a scheduled thread pool using the given thread pool profileExecutorService
newThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory)
Create a thread pool using the given thread pool profile
-
-
-
Field Detail
-
FACTORY
static final String FACTORY
Service factory key.- See Also:
- Constant Field Values
-
-
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 methodExecutors.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 poolthreadFactory
- 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 poolthreadFactory
- factory for creating threads- Returns:
- the created thread pool
-
-