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 customizing 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
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionnewCachedThreadPool
(ThreadFactory threadFactory) Creates a new cached thread poolnewScheduledThreadPool
(ThreadPoolProfile profile, ThreadFactory threadFactory) Create a scheduled thread pool using the given thread pool profilenewThreadPool
(ThreadPoolProfile profile, ThreadFactory threadFactory) Create a thread pool using the given thread pool profile
-
Field Details
-
FACTORY
Service factory key.- See Also:
-
-
Method Details
-
newCachedThreadPool
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
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
-