public class ThreadsDefinition extends OutputDefinition<ThreadsDefinition> implements ExecutorServiceAwareDefinition<ThreadsDefinition>
outputsinheritErrorHandler, log| Constructor and Description |
|---|
ThreadsDefinition() |
| Modifier and Type | Method and Description |
|---|---|
ThreadsDefinition |
callerRunsWhenRejected(boolean callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool.
|
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor
based on the definition model.
|
ThreadsDefinition |
executorService(ExecutorService executorService)
Setting the executor service for executing
|
ThreadsDefinition |
executorServiceRef(String executorServiceRef)
Setting the executor service for executing
|
Boolean |
getCallerRunsWhenRejected() |
ExecutorService |
getExecutorService()
Gets the executor service
|
String |
getExecutorServiceRef()
Gets the reference to lookup in the
Registry for the executor service to be used. |
Long |
getKeepAliveTime() |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
Integer |
getMaxPoolSize() |
Integer |
getMaxQueueSize() |
Integer |
getPoolSize() |
ThreadPoolRejectedPolicy |
getRejectedPolicy() |
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images
|
String |
getThreadName() |
TimeUnit |
getTimeUnit() |
ThreadsDefinition |
keepAliveTime(long keepAliveTime)
Sets the keep alive time for idle threads
|
ThreadsDefinition |
maxPoolSize(int maxPoolSize)
Sets the maximum pool size for the underlying
ExecutorService. |
ThreadsDefinition |
maxQueueSize(int maxQueueSize)
Sets the maximum number of tasks in the work queue.
|
ThreadsDefinition |
poolSize(int poolSize)
Sets the core pool size for the underlying
ExecutorService. |
ThreadsDefinition |
rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
Sets the handler for tasks which cannot be executed by the thread pool.
|
protected ThreadPoolRejectedPolicy |
resolveRejectedPolicy(RouteContext routeContext) |
void |
setCallerRunsWhenRejected(Boolean callerRunsWhenRejected) |
void |
setExecutorService(ExecutorService executorService)
Sets the executor service to be used.
|
void |
setExecutorServiceRef(String executorServiceRef)
Sets a reference to lookup in the
Registry for the executor service to be used. |
void |
setKeepAliveTime(Long keepAliveTime) |
void |
setMaxPoolSize(Integer maxPoolSize) |
void |
setMaxQueueSize(Integer maxQueueSize) |
void |
setPoolSize(Integer poolSize) |
void |
setRejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy) |
void |
setThreadName(String threadName) |
void |
setTimeUnit(TimeUnit timeUnit) |
ThreadsDefinition |
threadName(String threadName)
Sets the thread name to use.
|
ThreadsDefinition |
timeUnit(TimeUnit keepAliveTimeUnits)
Sets the keep alive time unit.
|
String |
toString() |
getOutputs, isOutputSupported, setOutputsaddInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, enrich, enrich, enrichRef, filter, filter, filter, filter, getIndex, getInterceptStrategies, getOtherAttributes, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, isTopLevelOnly, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, preCreateProcessor, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperty, resequence, resequence, resolveKnownConstantFields, resolvePropertyPlaceholders, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, stop, threads, threads, threads, threads, throttle, throttle, throwException, to, to, to, to, to, to, to, to, to, to, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessordescription, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, isCustomId, setCustomId, setDescription, setIdpublic ThreadsDefinition()
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinitioncreateProcessor in class ProcessorDefinition<ThreadsDefinition>Exceptionprotected ThreadPoolRejectedPolicy resolveRejectedPolicy(RouteContext routeContext)
public String getLabel()
ProcessorDefinitiongetLabel in interface NamedNodegetLabel in class ProcessorDefinition<ThreadsDefinition>public String getShortName()
OptionalIdentifiedDefinitiongetShortName in interface NamedNodegetShortName in class OutputDefinition<ThreadsDefinition>public String toString()
toString in class OutputDefinition<ThreadsDefinition>public ThreadsDefinition executorService(ExecutorService executorService)
ExecutorServiceAwareDefinitionexecutorService in interface ExecutorServiceAwareDefinition<ThreadsDefinition>executorService - the executor servicepublic ThreadsDefinition executorServiceRef(String executorServiceRef)
ExecutorServiceAwareDefinitionexecutorServiceRef in interface ExecutorServiceAwareDefinition<ThreadsDefinition>executorServiceRef - reference for a ExecutorService
to lookup in the Registrypublic ThreadsDefinition poolSize(int poolSize)
ExecutorService.poolSize - the core pool size to keep minimum in the poolpublic ThreadsDefinition maxPoolSize(int maxPoolSize)
ExecutorService.maxPoolSize - the maximum pool sizepublic ThreadsDefinition keepAliveTime(long keepAliveTime)
keepAliveTime - keep alive timepublic ThreadsDefinition timeUnit(TimeUnit keepAliveTimeUnits)
keepAliveTimeUnits - time unitpublic ThreadsDefinition maxQueueSize(int maxQueueSize)
maxQueueSize - the max queue sizepublic ThreadsDefinition rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
rejectedPolicy - the policy for the handlerpublic ThreadsDefinition threadName(String threadName)
threadName - the thread namepublic ThreadsDefinition callerRunsWhenRejected(boolean callerRunsWhenRejected)
callerRunsWhenRejected - whether or not the caller should runpublic ExecutorService getExecutorService()
ExecutorServiceAwaregetExecutorService in interface ExecutorServiceAwarepublic void setExecutorService(ExecutorService executorService)
ExecutorServiceAwaresetExecutorService in interface ExecutorServiceAwareexecutorService - the executorpublic String getExecutorServiceRef()
ExecutorServiceAwareRegistry for the executor service to be used.getExecutorServiceRef in interface ExecutorServiceAwarepublic void setExecutorServiceRef(String executorServiceRef)
ExecutorServiceAwareRegistry for the executor service to be used.setExecutorServiceRef in interface ExecutorServiceAwareexecutorServiceRef - reference for the executorpublic Integer getPoolSize()
public void setPoolSize(Integer poolSize)
public Integer getMaxPoolSize()
public void setMaxPoolSize(Integer maxPoolSize)
public Long getKeepAliveTime()
public void setKeepAliveTime(Long keepAliveTime)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public Integer getMaxQueueSize()
public void setMaxQueueSize(Integer maxQueueSize)
public String getThreadName()
public void setThreadName(String threadName)
public ThreadPoolRejectedPolicy getRejectedPolicy()
public void setRejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
public Boolean getCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)
Apache Camel