Class DefaultThreadPoolFactory
- java.lang.Object
-
- org.exoplatform.social.common.service.thread.DefaultThreadPoolFactory
-
- All Implemented Interfaces:
ThreadPoolFactory
public class DefaultThreadPoolFactory extends Object implements ThreadPoolFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultThreadPoolFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServicenewCachedThreadPool(ThreadFactory threadFactory)Creates a new cached thread pool
The cached thread pool is a term from the JDK from the methodExecutors.newCachedThreadPool().ScheduledExecutorServicenewScheduledThreadPool(ThreadPoolConfig config, ThreadFactory threadFactory)Create a scheduled thread pool using the given thread pool profileExecutorServicenewThreadPool(int corePoolSize, int maxPoolSize, long keepAliveTime, TimeUnit timeUnit, int maxQueueSize, ThreadFactory threadFactory)ExecutorServicenewThreadPool(ThreadPoolConfig config, ThreadFactory factory)Create a thread pool using the given thread pool profile
-
-
-
Method Detail
-
newCachedThreadPool
public ExecutorService newCachedThreadPool(ThreadFactory threadFactory)
Description copied from interface:ThreadPoolFactoryCreates 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- Specified by:
newCachedThreadPoolin interfaceThreadPoolFactory- Parameters:
threadFactory- factory for creating threads- Returns:
- the created thread pool
-
newThreadPool
public ExecutorService newThreadPool(ThreadPoolConfig config, ThreadFactory factory)
Description copied from interface:ThreadPoolFactoryCreate a thread pool using the given thread pool profile- Specified by:
newThreadPoolin interfaceThreadPoolFactory- Parameters:
config- parameters of the thread poolfactory- factory for creating threads- Returns:
- the created thread pool
-
newThreadPool
public ExecutorService newThreadPool(int corePoolSize, int maxPoolSize, long keepAliveTime, TimeUnit timeUnit, int maxQueueSize, ThreadFactory threadFactory) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(ThreadPoolConfig config, ThreadFactory threadFactory)
Description copied from interface:ThreadPoolFactoryCreate a scheduled thread pool using the given thread pool profile- Specified by:
newScheduledThreadPoolin interfaceThreadPoolFactory- Parameters:
config- parameters of the thread poolthreadFactory- factory for creating threads- Returns:
- the created thread pool
-
-