Class ExecutorServiceManagerImpl
- java.lang.Object
-
- org.exoplatform.social.common.service.impl.ExecutorServiceManagerImpl
-
- All Implemented Interfaces:
ExecutorServiceManager,org.picocontainer.Startable
public class ExecutorServiceManagerImpl extends Object implements ExecutorServiceManager, org.picocontainer.Startable
-
-
Constructor Summary
Constructors Constructor Description ExecutorServiceManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetThreadNamePattern()Gets the thread name patter to useThreadPoolConfiggetThreadPoolConfig(String id)ExecutorServicenewDefaultThreadPool(String name)Creates a new thread pool using the default thread pool profile.ThreadnewThread(String name, Runnable runnable)Creates a new daemon thread with the given name.ExecutorServicenewThreadPool(String name, ThreadPoolConfig config)voidsetThreadNamePattern(String pattern)Sets the thread name pattern used for creating the full thread name.voidstart()voidstop()
-
-
-
Method Detail
-
setThreadNamePattern
public void setThreadNamePattern(String pattern) throws IllegalArgumentException
Description copied from interface:ExecutorServiceManagerSets the thread name pattern used for creating the full thread name.- Specified by:
setThreadNamePatternin interfaceExecutorServiceManager- Parameters:
pattern- the pattern- Throws:
IllegalArgumentException- if the pattern is invalid.
-
getThreadNamePattern
public String getThreadNamePattern()
Description copied from interface:ExecutorServiceManagerGets the thread name patter to use- Specified by:
getThreadNamePatternin interfaceExecutorServiceManager- Returns:
- the pattern
-
newThread
public Thread newThread(String name, Runnable runnable)
Description copied from interface:ExecutorServiceManagerCreates a new daemon thread with the given name.- Specified by:
newThreadin interfaceExecutorServiceManager- Parameters:
name- name which is appended to the thread namerunnable- a runnable to be executed by new thread instance- Returns:
- the created thread
-
newDefaultThreadPool
public ExecutorService newDefaultThreadPool(String name)
Description copied from interface:ExecutorServiceManagerCreates a new thread pool using the default thread pool profile.- Specified by:
newDefaultThreadPoolin interfaceExecutorServiceManager- Parameters:
name- name which is appended to the thread name- Returns:
- the created thread pool
-
getThreadPoolConfig
public ThreadPoolConfig getThreadPoolConfig(String id)
- Specified by:
getThreadPoolConfigin interfaceExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(String name, ThreadPoolConfig config)
- Specified by:
newThreadPoolin interfaceExecutorServiceManager
-
start
public void start()
- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.picocontainer.Startable
-
-