|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ExecutorServiceManager instead, will be removed in a future Camel release
@Deprecated public interface ExecutorServiceStrategy
Strategy to create thread pools.
This strategy is pluggable so you can plugin a custom provider, for example if you want to leverage the WorkManager for a J2EE server. This strategy has fine grained methods for creating various thread pools, however custom strategies do not have to exactly create those kind of pools. Feel free to return a shared or different kind of pool. However there are two types of pools: regular and scheduled. If you use the newXXX methods to create thread pools, then Camel will by default take care of shutting down those created pools whenCamelContext is shutting down.
| Method Summary | |
|---|---|
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. Lookup a ExecutorService from the Registry
and from known list of ThreadPoolProfile(s). |
ScheduledExecutorService |
lookupScheduled(Object source,
String name,
String executorServiceRef)
Deprecated. Lookup a ScheduledExecutorService from the Registry
and from known list of ThreadPoolProfile(s). |
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. |
| Methods inherited from interface org.apache.camel.ShutdownableService |
|---|
shutdown |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Method Detail |
|---|
void registerThreadPoolProfile(ThreadPoolProfile profile)
profile - the profileThreadPoolProfile getThreadPoolProfile(String id)
id - id of the thread pool profile to get
ThreadPoolProfile getDefaultThreadPoolProfile()
void setDefaultThreadPoolProfile(ThreadPoolProfile defaultThreadPoolProfile)
defaultThreadPoolProfile - the new default thread pool profileString getThreadName(String name)
name - name which is appended to the full thread name
String getThreadNamePattern()
void setThreadNamePattern(String pattern)
throws IllegalArgumentException
CamelContext
pattern - the pattern
IllegalArgumentException - if the pattern is invalid.
ExecutorService lookup(Object source,
String name,
String executorServiceRef)
ExecutorService from the Registry
and from known list of ThreadPoolProfile(s).
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread nameexecutorServiceRef - reference to lookup
ExecutorService or null if not found
ScheduledExecutorService lookupScheduled(Object source,
String name,
String executorServiceRef)
ScheduledExecutorService from the Registry
and from known list of ThreadPoolProfile(s).
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread nameexecutorServiceRef - reference to lookup
ScheduledExecutorService or null if not found
ExecutorService newDefaultThreadPool(Object source,
String name)
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread name
ExecutorService newThreadPool(Object source,
String name,
String threadPoolProfileId)
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 pool
ExecutorService newCachedThreadPool(Object source,
String name)
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread name
ScheduledExecutorService newScheduledThreadPool(Object source,
String name,
int poolSize)
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
ScheduledExecutorService newScheduledThreadPool(Object source,
String name)
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread name
ExecutorService newFixedThreadPool(Object source,
String name,
int poolSize)
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
ExecutorService newSingleThreadExecutor(Object source,
String name)
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread name
ExecutorService newSynchronousThreadPool(Object source,
String name)
source - the source object, usually it should be this passed in as parametername - name which is appended to the thread name
ExecutorService newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize)
CallerRunsPolicy as rejection handler
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 size
ExecutorService newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize,
int maxQueueSize)
CallerRunsPolicy as rejection handler
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 unbounded
ExecutorService newThreadPool(Object source,
String name,
int corePoolSize,
int maxPoolSize,
long keepAliveTime,
TimeUnit timeUnit,
int maxQueueSize,
RejectedExecutionHandler rejectedExecutionHandler,
boolean daemon)
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 not
void shutdown(ExecutorService executorService)
executorService - the executor service to shutdownExecutorService.shutdown()List<Runnable> shutdownNow(ExecutorService executorService)
executorService - the executor service to shutdown now
ExecutorService.shutdownNow()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||