ExecutorServiceManager
instead, will be removed in a future Camel release@Deprecated public class DefaultExecutorServiceStrategy extends ServiceSupport implements ExecutorServiceStrategy
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
DefaultExecutorServiceStrategy(CamelContext camelContext)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Deprecated.
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Deprecated.
Implementations override this method to support customized start/stop.
|
ThreadPoolProfile |
getDefaultThreadPoolProfile()
Deprecated.
Gets the default thread pool profile
|
String |
getThreadName(String name)
Deprecated.
Creates a full thread name
|
String |
getThreadNamePattern()
Deprecated.
Gets the thread name pattern used for creating the full thread name.
|
ThreadPoolProfile |
getThreadPoolProfile(String id)
Deprecated.
Gets the thread pool profile by the given id
|
ExecutorService |
lookup(Object source,
String name,
String executorServiceRef)
Deprecated.
|
ScheduledExecutorService |
lookupScheduled(Object source,
String name,
String executorServiceRef)
Deprecated.
|
ExecutorService |
newCachedThreadPool(Object source,
String name)
Deprecated.
Creates a new cached thread pool.
|
ExecutorService |
newDefaultThreadPool(Object source,
String name)
Deprecated.
Creates a new thread pool using the default thread pool profile.
|
ExecutorService |
newFixedThreadPool(Object source,
String name,
int poolSize)
Deprecated.
Creates a new fixed thread pool.
|
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name)
Deprecated.
Creates a new scheduled thread pool.
|
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
int poolSize)
Deprecated.
Creates a new scheduled thread pool.
|
ExecutorService |
newSingleThreadExecutor(Object source,
String name)
Deprecated.
Creates a new single-threaded thread pool.
|
ExecutorService |
newSynchronousThreadPool(Object source,
String name)
Deprecated.
Creates a new synchronous thread pool, which executes the task in the caller thread (no task queue).
|
ExecutorService |
newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize)
Deprecated.
Creates a new custom thread pool.
|
ExecutorService |
newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize,
int maxQueueSize)
Deprecated.
Creates a new custom thread pool.
|
ExecutorService |
newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
int maxQueueSize,
RejectedExecutionHandler rejectedExecutionHandler,
boolean daemon)
Deprecated.
Creates a new custom thread pool.
|
ExecutorService |
newThreadPool(Object source,
String name,
String threadPoolProfileId)
Deprecated.
Creates a new thread pool using based on the given profile id.
|
void |
registerThreadPoolProfile(ThreadPoolProfile profile)
Deprecated.
Registers the given thread pool profile
|
void |
setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
Deprecated.
Sets the default thread pool profile
|
void |
setThreadNamePattern(String pattern)
Deprecated.
Sets the thread name pattern used for creating the full thread name.
|
void |
shutdown(ExecutorService executorService)
Deprecated.
Shutdown the given executor service.
|
List<Runnable> |
shutdownNow(ExecutorService executorService)
Deprecated.
Shutdown now the given executor service.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shutdown
public DefaultExecutorServiceStrategy(CamelContext camelContext)
public void registerThreadPoolProfile(ThreadPoolProfile profile)
ExecutorServiceStrategy
registerThreadPoolProfile
in interface ExecutorServiceStrategy
profile
- the profilepublic ThreadPoolProfile getThreadPoolProfile(String id)
ExecutorServiceStrategy
getThreadPoolProfile
in interface ExecutorServiceStrategy
id
- id of the thread pool profile to getpublic ThreadPoolProfile getDefaultThreadPoolProfile()
ExecutorServiceStrategy
getDefaultThreadPoolProfile
in interface ExecutorServiceStrategy
public void setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
ExecutorServiceStrategy
setDefaultThreadPoolProfile
in interface ExecutorServiceStrategy
defaultThreadPoolProfile
- the new default thread pool profilepublic String getThreadName(String name)
ExecutorServiceStrategy
getThreadName
in interface ExecutorServiceStrategy
name
- name which is appended to the full thread namepublic String getThreadNamePattern()
ExecutorServiceStrategy
getThreadNamePattern
in interface ExecutorServiceStrategy
public void setThreadNamePattern(String pattern) throws IllegalArgumentException
ExecutorServiceStrategy
CamelContext
setThreadNamePattern
in interface ExecutorServiceStrategy
pattern
- the patternIllegalArgumentException
- if the pattern is invalid.public ExecutorService lookup(Object source, String name, String executorServiceRef)
ExecutorServiceStrategy
lookup
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameexecutorServiceRef
- reference to lookupExecutorService
or null if not foundpublic ScheduledExecutorService lookupScheduled(Object source, String name, String executorServiceRef)
ExecutorServiceStrategy
lookupScheduled
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread nameexecutorServiceRef
- reference to lookupScheduledExecutorService
or null if not foundpublic ExecutorService newDefaultThreadPool(Object source, String name)
ExecutorServiceStrategy
newDefaultThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepublic ExecutorService newThreadPool(Object source, String name, String threadPoolProfileId)
ExecutorServiceStrategy
newThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namethreadPoolProfileId
- id of the thread pool profile to use for creating the thread poolpublic ExecutorService newCachedThreadPool(Object source, String name)
ExecutorServiceStrategy
newCachedThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepublic ScheduledExecutorService newScheduledThreadPool(Object source, String name, int poolSize)
ExecutorServiceStrategy
newScheduledThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepoolSize
- the core pool sizepublic ScheduledExecutorService newScheduledThreadPool(Object source, String name)
ExecutorServiceStrategy
newScheduledThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepublic ExecutorService newFixedThreadPool(Object source, String name, int poolSize)
ExecutorServiceStrategy
newFixedThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepoolSize
- the core pool sizepublic ExecutorService newSingleThreadExecutor(Object source, String name)
ExecutorServiceStrategy
newSingleThreadExecutor
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepublic ExecutorService newSynchronousThreadPool(Object source, String name)
ExecutorServiceStrategy
newSynchronousThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namepublic ExecutorService newThreadPool(Object source, String name, int corePoolSize, int maxPoolSize)
ExecutorServiceStrategy
CallerRunsPolicy
as rejection handlernewThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namecorePoolSize
- the core pool sizemaxPoolSize
- the maximum pool sizepublic ExecutorService newThreadPool(Object source, String name, int corePoolSize, int maxPoolSize, int maxQueueSize)
ExecutorServiceStrategy
CallerRunsPolicy
as rejection handlernewThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namecorePoolSize
- the core pool sizemaxPoolSize
- the maximum pool sizemaxQueueSize
- the maximum number of tasks in the queue, use Integer.MAX_INT or -1 to indicate unboundedpublic ExecutorService newThreadPool(Object source, String name, int corePoolSize, int maxPoolSize, long keepAliveTime, TimeUnit timeUnit, int maxQueueSize, RejectedExecutionHandler rejectedExecutionHandler, boolean daemon)
ExecutorServiceStrategy
newThreadPool
in interface ExecutorServiceStrategy
source
- the source object, usually it should be this passed in as parametername
- name which is appended to the thread namecorePoolSize
- the core pool sizemaxPoolSize
- the maximum pool sizekeepAliveTime
- keep alive time for idle threadstimeUnit
- time unit for keep alive timemaxQueueSize
- the maximum number of tasks in the queue, use Integer.MAX_INT or -1 to indicate unboundedrejectedExecutionHandler
- the handler for tasks which cannot be executed by the thread pool.
If null is provided then CallerRunsPolicy
is used.daemon
- whether or not the created threads is daemon or notpublic void shutdown(ExecutorService executorService)
ExecutorServiceStrategy
shutdown
in interface ExecutorServiceStrategy
executorService
- the executor service to shutdownExecutorService.shutdown()
public List<Runnable> shutdownNow(ExecutorService executorService)
ExecutorServiceStrategy
shutdownNow
in interface ExecutorServiceStrategy
executorService
- the executor service to shutdown nowExecutorService.shutdownNow()
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()
Apache Camel