org.exoplatform.social.common.service.impl
Class ExecutorServiceManagerImpl

java.lang.Object
  extended by org.exoplatform.social.common.service.impl.ExecutorServiceManagerImpl
All Implemented Interfaces:
ExecutorServiceManager

public class ExecutorServiceManagerImpl
extends Object
implements ExecutorServiceManager


Constructor Summary
ExecutorServiceManagerImpl()
           
 
Method Summary
 String getThreadNamePattern()
          Gets the thread name patter to use
 ThreadPoolConfig getThreadPoolConfig(String id)
           
 ExecutorService newDefaultThreadPool(String name)
          Creates a new thread pool using the default thread pool profile.
 Thread newThread(String name, Runnable runnable)
          Creates a new daemon thread with the given name.
 ExecutorService newThreadPool(String name, ThreadPoolConfig config)
           
 void setThreadNamePattern(String pattern)
          Sets the thread name pattern used for creating the full thread name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorServiceManagerImpl

public ExecutorServiceManagerImpl()
Method Detail

setThreadNamePattern

public void setThreadNamePattern(String pattern)
                          throws IllegalArgumentException
Description copied from interface: ExecutorServiceManager
Sets the thread name pattern used for creating the full thread name.

Specified by:
setThreadNamePattern in interface ExecutorServiceManager
Parameters:
pattern - the pattern
Throws:
IllegalArgumentException - if the pattern is invalid.

getThreadNamePattern

public String getThreadNamePattern()
Description copied from interface: ExecutorServiceManager
Gets the thread name patter to use

Specified by:
getThreadNamePattern in interface ExecutorServiceManager
Returns:
the pattern

newThread

public Thread newThread(String name,
                        Runnable runnable)
Description copied from interface: ExecutorServiceManager
Creates a new daemon thread with the given name.

Specified by:
newThread in interface ExecutorServiceManager
Parameters:
name - name which is appended to the thread name
runnable - a runnable to be executed by new thread instance
Returns:
the created thread

newDefaultThreadPool

public ExecutorService newDefaultThreadPool(String name)
Description copied from interface: ExecutorServiceManager
Creates a new thread pool using the default thread pool profile.

Specified by:
newDefaultThreadPool in interface ExecutorServiceManager
Parameters:
name - name which is appended to the thread name
Returns:
the created thread pool

getThreadPoolConfig

public ThreadPoolConfig getThreadPoolConfig(String id)
Specified by:
getThreadPoolConfig in interface ExecutorServiceManager

newThreadPool

public ExecutorService newThreadPool(String name,
                                     ThreadPoolConfig config)
Specified by:
newThreadPool in interface ExecutorServiceManager


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.