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, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshutdownpublic DefaultExecutorServiceStrategy(CamelContext camelContext)
public void registerThreadPoolProfile(ThreadPoolProfile profile)
ExecutorServiceStrategyregisterThreadPoolProfile in interface ExecutorServiceStrategyprofile - the profilepublic ThreadPoolProfile getThreadPoolProfile(String id)
ExecutorServiceStrategygetThreadPoolProfile in interface ExecutorServiceStrategyid - id of the thread pool profile to getpublic ThreadPoolProfile getDefaultThreadPoolProfile()
ExecutorServiceStrategygetDefaultThreadPoolProfile in interface ExecutorServiceStrategypublic void setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
ExecutorServiceStrategysetDefaultThreadPoolProfile in interface ExecutorServiceStrategydefaultThreadPoolProfile - the new default thread pool profilepublic String getThreadName(String name)
ExecutorServiceStrategygetThreadName in interface ExecutorServiceStrategyname - name which is appended to the full thread namepublic String getThreadNamePattern()
ExecutorServiceStrategygetThreadNamePattern in interface ExecutorServiceStrategypublic void setThreadNamePattern(String pattern) throws IllegalArgumentException
ExecutorServiceStrategyCamelContext
setThreadNamePattern in interface ExecutorServiceStrategypattern - the patternIllegalArgumentException - if the pattern is invalid.public ExecutorService lookup(Object source, String name, String executorServiceRef)
ExecutorServiceStrategylookup in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategylookupScheduled in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewDefaultThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewCachedThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewScheduledThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewScheduledThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewFixedThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewSingleThreadExecutor in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewSynchronousThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategyCallerRunsPolicy as rejection handlernewThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategyCallerRunsPolicy as rejection handlernewThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategynewThreadPool in interface ExecutorServiceStrategysource - 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)
ExecutorServiceStrategyshutdown in interface ExecutorServiceStrategyexecutorService - the executor service to shutdownExecutorService.shutdown()public List<Runnable> shutdownNow(ExecutorService executorService)
ExecutorServiceStrategyshutdownNow in interface ExecutorServiceStrategyexecutorService - the executor service to shutdown nowExecutorService.shutdownNow()protected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.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 ServiceSupportExceptionServiceSupport.doStart()Apache Camel