Package org.apache.camel.model
Class ThreadsDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<Type>
org.apache.camel.model.ProcessorDefinition<Type>
org.apache.camel.model.NoOutputDefinition<ThreadsDefinition>
org.apache.camel.model.ThreadsDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,Block
,ExecutorServiceAwareDefinition<ThreadsDefinition>
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
@Metadata(label="eip,routing")
public class ThreadsDefinition
extends NoOutputDefinition<ThreadsDefinition>
implements ExecutorServiceAwareDefinition<ThreadsDefinition>
Specifies that all steps after this node are processed asynchronously
-
Field Summary
Fields inherited from class org.apache.camel.model.ProcessorDefinition
disabled, inheritErrorHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowCoreThreadTimeOut
(boolean allowCoreThreadTimeOut) Whether idle core threads are allowed to timeout and therefore can shrink the pool size below the core pool sizeallowCoreThreadTimeOut
(String allowCoreThreadTimeOut) Whether idle core threads is allowed to timeout and therefore can shrink the pool size below the core pool sizecallerRunsWhenRejected
(boolean callerRunsWhenRejected) Whether or not to use as caller runs as fallback when a task is rejected being added to the thread pool (when its full).callerRunsWhenRejected
(String callerRunsWhenRejected) Whether or not to use as caller runs as fallback when a task is rejected being added to the thread pool (when its full).executorService
(String executorService) To refer to a custom thread pool or use a thread pool profile (as overlay)executorService
(ExecutorService executorService) To use a custom thread poolGets the executor service for executingGets a reference id to lookup the executor service from the registrygetLabel()
Returns a label to describe this node such as the expression if some kind of expression nodekeepAliveTime
(long keepAliveTime) Sets the keep alive time for idle threadskeepAliveTime
(String keepAliveTime) Sets the keep alive time for idle threadsmaxPoolSize
(int maxPoolSize) Sets the maximum pool sizemaxPoolSize
(String maxPoolSize) Sets the maximum pool sizemaxQueueSize
(int maxQueueSize) Sets the maximum number of tasks in the work queue.maxQueueSize
(String maxQueueSize) Sets the maximum number of tasks in the work queue.poolSize
(int poolSize) Sets the core pool sizeSets the core pool sizerejectedPolicy
(String rejectedPolicy) Sets the handler for tasks which cannot be executed by the thread pool.rejectedPolicy
(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy) Sets the handler for tasks which cannot be executed by the thread pool.void
setAllowCoreThreadTimeOut
(String allowCoreThreadTimeOut) void
setCallerRunsWhenRejected
(String callerRunsWhenRejected) void
setExecutorService
(String executorService) void
setKeepAliveTime
(String keepAliveTime) void
setMaxPoolSize
(String maxPoolSize) void
setMaxQueueSize
(String maxQueueSize) void
setPoolSize
(String poolSize) void
setRejectedPolicy
(String rejectedPolicy) void
setThreadName
(String threadName) void
setTimeUnit
(String timeUnit) threadName
(String threadName) Sets the thread name to use.Sets the keep alive time unit.Sets the keep alive time unit.toString()
Methods inherited from class org.apache.camel.model.NoOutputDefinition
getOutputs
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, configureChild, convertBodyTo, convertBodyTo, convertBodyTo, delay, delay, delay, disabled, disabled, disabled, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoCatch, endDoTry, endParent, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getDisabled, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, isAbstract, isInheritErrorHandler, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, nodePrefixId, onCompletion, onException, onException, pausable, pausable, pausable, pausable, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, resumable, resumable, resumable, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setDisabled, setExchangePattern, setExchangePattern, setHeader, setHeader, setHeader, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, sort, sort, sort, split, split, split, split, startupOrder, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
ThreadsDefinition
public ThreadsDefinition()
-
-
Method Details
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
-
getLabel
Description copied from class:ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
- Overrides:
getLabel
in classProcessorDefinition<ThreadsDefinition>
-
toString
-
executorService
To use a custom thread pool- Specified by:
executorService
in interfaceExecutorServiceAwareDefinition<ThreadsDefinition>
- Parameters:
executorService
- the executor service- Returns:
- the builder
-
executorService
To refer to a custom thread pool or use a thread pool profile (as overlay)- Specified by:
executorService
in interfaceExecutorServiceAwareDefinition<ThreadsDefinition>
- Parameters:
executorService
- reference for aExecutorService
to lookup in theRegistry
- Returns:
- the builder
-
poolSize
Sets the core pool size- Parameters:
poolSize
- the core pool size to keep minimum in the pool- Returns:
- the builder
-
poolSize
Sets the core pool size- Parameters:
poolSize
- the core pool size to keep minimum in the pool- Returns:
- the builder
-
maxPoolSize
Sets the maximum pool size- Parameters:
maxPoolSize
- the maximum pool size- Returns:
- the builder
-
maxPoolSize
Sets the maximum pool size- Parameters:
maxPoolSize
- the maximum pool size- Returns:
- the builder
-
keepAliveTime
Sets the keep alive time for idle threads- Parameters:
keepAliveTime
- keep alive time- Returns:
- the builder
-
keepAliveTime
Sets the keep alive time for idle threads- Parameters:
keepAliveTime
- keep alive time- Returns:
- the builder
-
timeUnit
Sets the keep alive time unit. By default SECONDS is used.- Parameters:
keepAliveTimeUnits
- time unit- Returns:
- the builder
-
timeUnit
Sets the keep alive time unit. By default SECONDS is used.- Parameters:
keepAliveTimeUnits
- time unit- Returns:
- the builder
-
maxQueueSize
Sets the maximum number of tasks in the work queue. Use -1 or Integer.MAX_VALUE for an unbounded queue- Parameters:
maxQueueSize
- the max queue size- Returns:
- the builder
-
maxQueueSize
Sets the maximum number of tasks in the work queue. Use -1 or Integer.MAX_VALUE for an unbounded queue- Parameters:
maxQueueSize
- the max queue size- Returns:
- the builder
-
rejectedPolicy
public ThreadsDefinition rejectedPolicy(org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy rejectedPolicy) Sets the handler for tasks which cannot be executed by the thread pool.- Parameters:
rejectedPolicy
- the policy for the handler- Returns:
- the builder
-
rejectedPolicy
Sets the handler for tasks which cannot be executed by the thread pool.- Parameters:
rejectedPolicy
- the policy for the handler- Returns:
- the builder
-
threadName
Sets the thread name to use.- Parameters:
threadName
- the thread name- Returns:
- the builder
-
callerRunsWhenRejected
Whether or not to use as caller runs as fallback when a task is rejected being added to the thread pool (when its full). This is only used as fallback if no rejectedPolicy has been configured, or the thread pool has no configured rejection handler. Is by default true- Parameters:
callerRunsWhenRejected
- whether or not the caller should run- Returns:
- the builder
-
callerRunsWhenRejected
Whether or not to use as caller runs as fallback when a task is rejected being added to the thread pool (when its full). This is only used as fallback if no rejectedPolicy has been configured, or the thread pool has no configured rejection handler. Is by default true- Parameters:
callerRunsWhenRejected
- whether or not the caller should run- Returns:
- the builder
-
allowCoreThreadTimeOut
Whether idle core threads are allowed to timeout and therefore can shrink the pool size below the core pool size Is by default false- Parameters:
allowCoreThreadTimeOut
- true to allow timeout- Returns:
- the builder
-
allowCoreThreadTimeOut
Whether idle core threads is allowed to timeout and therefore can shrink the pool size below the core pool size Is by default false- Parameters:
allowCoreThreadTimeOut
- true to allow timeout- Returns:
- the builder
-
getExecutorServiceBean
Description copied from interface:ExecutorServiceAwareDefinition
Gets the executor service for executing- Specified by:
getExecutorServiceBean
in interfaceExecutorServiceAwareDefinition<ThreadsDefinition>
-
getExecutorServiceRef
Description copied from interface:ExecutorServiceAwareDefinition
Gets a reference id to lookup the executor service from the registry- Specified by:
getExecutorServiceRef
in interfaceExecutorServiceAwareDefinition<ThreadsDefinition>
-
getPoolSize
-
setPoolSize
-
getMaxPoolSize
-
setMaxPoolSize
-
getKeepAliveTime
-
setKeepAliveTime
-
getTimeUnit
-
setTimeUnit
-
getMaxQueueSize
-
setMaxQueueSize
-
getThreadName
-
setThreadName
-
getRejectedPolicy
-
setRejectedPolicy
-
getCallerRunsWhenRejected
-
setCallerRunsWhenRejected
-
getAllowCoreThreadTimeOut
-
setAllowCoreThreadTimeOut
-
getExecutorService
-
setExecutorService
-