|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.ServiceSupport org.apache.camel.impl.DefaultExecutorServiceManager
public class DefaultExecutorServiceManager
Field Summary |
---|
Fields inherited from class org.apache.camel.support.ServiceSupport |
---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
Constructor Summary | |
---|---|
DefaultExecutorServiceManager(CamelContext camelContext)
|
Method Summary | |
---|---|
protected void |
doShutdown()
Implementations override this method to perform customized shutdown. |
protected void |
doStart()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
ThreadPoolProfile |
getDefaultThreadPoolProfile()
Gets the default thread pool profile |
String |
getThreadNamePattern()
Gets the thread name patter to use |
ThreadPoolFactory |
getThreadPoolFactory()
Gets the ThreadPoolFactory to use for creating the thread pools. |
ThreadPoolProfile |
getThreadPoolProfile(String id)
Gets the thread pool profile by the given id |
ExecutorService |
newCachedThreadPool(Object source,
String name)
Creates a new cached thread pool. |
ScheduledExecutorService |
newDefaultScheduledThreadPool(Object source,
String name)
Creates a new scheduled thread pool using the default thread pool profile. |
ExecutorService |
newDefaultThreadPool(Object source,
String name)
Creates a new thread pool using the default thread pool profile. |
ExecutorService |
newFixedThreadPool(Object source,
String name,
int poolSize)
Creates a new fixed thread pool. |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
int poolSize)
Creates a new scheduled thread pool. |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
String profileId)
Creates a new scheduled thread pool using a profile id |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
ThreadPoolProfile profile)
Creates a new scheduled thread pool using a profile |
ExecutorService |
newSingleThreadExecutor(Object source,
String name)
Creates a new single-threaded thread pool. |
ScheduledExecutorService |
newSingleThreadScheduledExecutor(Object source,
String name)
Creates a new single-threaded thread pool. |
ExecutorService |
newThreadPool(Object source,
String name,
int poolSize,
int maxPoolSize)
Creates a new thread pool. |
ExecutorService |
newThreadPool(Object source,
String name,
String profileId)
Creates a new thread pool using using the given profile id |
ExecutorService |
newThreadPool(Object source,
String name,
ThreadPoolProfile profile)
Creates a new thread pool using the given profile |
protected void |
onNewExecutorService(ExecutorService executorService)
Strategy callback when a new ExecutorService have been created. |
void |
registerThreadPoolProfile(ThreadPoolProfile profile)
Registers the given thread pool profile |
String |
resolveThreadName(String name)
Creates a full thread name |
void |
setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
Sets the default thread pool profile |
void |
setThreadNamePattern(String threadNamePattern)
Sets the thread name pattern used for creating the full thread name. |
void |
setThreadPoolFactory(ThreadPoolFactory threadPoolFactory)
Sets a custom ThreadPoolFactory to use |
void |
shutdown(ExecutorService executorService)
Shutdown the given executor service. |
List<Runnable> |
shutdownNow(ExecutorService executorService)
Shutdown now the given executor service. |
Methods inherited from class org.apache.camel.support.ServiceSupport |
---|
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.camel.ShutdownableService |
---|
shutdown |
Methods inherited from interface org.apache.camel.Service |
---|
start, stop |
Constructor Detail |
---|
public DefaultExecutorServiceManager(CamelContext camelContext)
Method Detail |
---|
public ThreadPoolFactory getThreadPoolFactory()
ExecutorServiceManager
ThreadPoolFactory
to use for creating the thread pools.
getThreadPoolFactory
in interface ExecutorServiceManager
public void setThreadPoolFactory(ThreadPoolFactory threadPoolFactory)
ExecutorServiceManager
ThreadPoolFactory
to use
setThreadPoolFactory
in interface ExecutorServiceManager
threadPoolFactory
- the thread pool factorypublic void registerThreadPoolProfile(ThreadPoolProfile profile)
ExecutorServiceManager
registerThreadPoolProfile
in interface ExecutorServiceManager
profile
- the profilepublic ThreadPoolProfile getThreadPoolProfile(String id)
ExecutorServiceManager
getThreadPoolProfile
in interface ExecutorServiceManager
id
- id of the thread pool profile to get
public ThreadPoolProfile getDefaultThreadPoolProfile()
ExecutorServiceManager
getDefaultThreadPoolProfile
in interface ExecutorServiceManager
public void setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
ExecutorServiceManager
setDefaultThreadPoolProfile
in interface ExecutorServiceManager
defaultThreadPoolProfile
- the new default thread pool profilepublic String getThreadNamePattern()
ExecutorServiceManager
getThreadNamePattern
in interface ExecutorServiceManager
public void setThreadNamePattern(String threadNamePattern)
ExecutorServiceManager
CamelContext
setThreadNamePattern
in interface ExecutorServiceManager
threadNamePattern
- the patternpublic String resolveThreadName(String name)
ExecutorServiceManager
resolveThreadName
in interface ExecutorServiceManager
name
- name which is appended to the full thread name
public ExecutorService newDefaultThreadPool(Object source, String name)
ExecutorServiceManager
newDefaultThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread name
public ScheduledExecutorService newDefaultScheduledThreadPool(Object source, String name)
ExecutorServiceManager
newDefaultScheduledThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread name
public ExecutorService newThreadPool(Object source, String name, String profileId)
ExecutorServiceManager
newThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameprofileId
- the id of the profile with the thread pool settings to use
public ExecutorService newThreadPool(Object source, String name, ThreadPoolProfile profile)
ExecutorServiceManager
newThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameprofile
- the profile with the thread pool settings to use
public ExecutorService newThreadPool(Object source, String name, int poolSize, int maxPoolSize)
ExecutorServiceManager
newThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepoolSize
- the core pool sizemaxPoolSize
- the maximum pool size
public ExecutorService newSingleThreadExecutor(Object source, String name)
ExecutorServiceManager
newSingleThreadExecutor
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread name
public ExecutorService newCachedThreadPool(Object source, String name)
ExecutorServiceManager
newCachedThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread name
public ExecutorService newFixedThreadPool(Object source, String name, int poolSize)
ExecutorServiceManager
newFixedThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepoolSize
- the core pool size
public ScheduledExecutorService newSingleThreadScheduledExecutor(Object source, String name)
ExecutorServiceManager
newSingleThreadScheduledExecutor
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread name
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, ThreadPoolProfile profile)
ExecutorServiceManager
newScheduledThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameprofile
- the profile with the thread pool settings to use
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, String profileId)
ExecutorServiceManager
newScheduledThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameprofileId
- the id of the profile with the thread pool settings to use
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, int poolSize)
ExecutorServiceManager
newScheduledThreadPool
in interface ExecutorServiceManager
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepoolSize
- the core pool size
public void shutdown(ExecutorService executorService)
ExecutorServiceManager
shutdown
in interface ExecutorServiceManager
executorService
- the executor service to shutdownExecutorService.shutdown()
public List<Runnable> shutdownNow(ExecutorService executorService)
ExecutorServiceManager
shutdownNow
in interface ExecutorServiceManager
executorService
- the executor service to shutdown now
ExecutorService.shutdownNow()
protected void onNewExecutorService(ExecutorService executorService)
ExecutorService
have been created.
executorService
- the created ExecutorService
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.
doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.
doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
protected void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |