org.exoplatform.social.common.service.thread
Class DefaultThreadPoolFactory
java.lang.Object
org.exoplatform.social.common.service.thread.DefaultThreadPoolFactory
- All Implemented Interfaces:
- ThreadPoolFactory
public class DefaultThreadPoolFactory
- extends Object
- implements ThreadPoolFactory
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultThreadPoolFactory
public DefaultThreadPoolFactory()
newCachedThreadPool
public ExecutorService newCachedThreadPool(ThreadFactory threadFactory)
- Description copied from interface:
ThreadPoolFactory
- 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
- Specified by:
newCachedThreadPool in interface ThreadPoolFactory
- Parameters:
threadFactory - factory for creating threads
- Returns:
- the created thread pool
newThreadPool
public ExecutorService newThreadPool(ThreadPoolConfig config,
ThreadFactory factory)
- Description copied from interface:
ThreadPoolFactory
- Create a thread pool using the given thread pool profile
- Specified by:
newThreadPool in interface ThreadPoolFactory
- 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:
ThreadPoolFactory
- Create a scheduled thread pool using the given thread pool profile
- Specified by:
newScheduledThreadPool in interface ThreadPoolFactory
- Parameters:
config - parameters of the thread poolthreadFactory - factory for creating threads
- Returns:
- the created thread pool
Copyright © 2003–2014 eXo Platform SAS. All rights reserved.