Package org.apache.camel.model
Class DelayDefinition
- java.lang.Object
-
- org.apache.camel.model.OptionalIdentifiedDefinition<Type>
-
- org.apache.camel.model.ProcessorDefinition<ExpressionNode>
-
- org.apache.camel.model.ExpressionNode
-
- org.apache.camel.model.DelayDefinition
-
- All Implemented Interfaces:
org.apache.camel.ExecutorServiceAware
,Block
,ExecutorServiceAwareDefinition<DelayDefinition>
,HasExpressionType
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
@Metadata(label="eip,routing") public class DelayDefinition extends ExpressionNode implements ExecutorServiceAwareDefinition<DelayDefinition>
Delays processing for a specified length of time
-
-
Field Summary
-
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler, log
-
-
Constructor Summary
Constructors Constructor Description DelayDefinition()
DelayDefinition(org.apache.camel.Expression delay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DelayDefinition
asyncDelayed()
Enables asynchronous delay which means the thread will not block while delaying.DelayDefinition
callerRunsWhenRejected(boolean callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool.DelayDefinition
delayTime(Long delay)
Sets the delay time in millis to delayDelayDefinition
executorService(ExecutorService executorService)
To use a custom Thread Pool if asyncDelay has been enabled.DelayDefinition
executorServiceRef(String executorServiceRef)
Refers to a custom Thread Pool if asyncDelay has been enabled.String
getAsyncDelayed()
String
getCallerRunsWhenRejected()
ExecutorService
getExecutorService()
String
getExecutorServiceRef()
String
getLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeString
getShortName()
void
setAsyncDelayed(String asyncDelayed)
void
setCallerRunsWhenRejected(String callerRunsWhenRejected)
void
setExecutorService(ExecutorService executorService)
void
setExecutorServiceRef(String executorServiceRef)
void
setExpression(ExpressionDefinition expression)
Expression to define how long time to wait (in millis)DelayDefinition
syncDelayed()
Enables asynchronous delay which means the thread will not block while delaying.String
toString()
-
Methods inherited from class org.apache.camel.model.ExpressionNode
configureChild, getExpression, getExpressionType, getOutputs, id, preCreateProcessor, setExpression, setExpressionType
-
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, convertBodyTo, convertBodyTo, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoTry, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getIndex, getInterceptStrategies, getParent, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, 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, onCompletion, onException, onException, pipeline, 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, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setExchangePattern, setHeader, setHeader, setHeader, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, 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, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCustomId, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setGeneratedId, setId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.camel.model.ExecutorServiceAwareDefinition
executorService
-
-
-
-
Method Detail
-
getShortName
public String getShortName()
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
-
getLabel
public String 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 classExpressionNode
-
delayTime
public DelayDefinition delayTime(Long delay)
Sets the delay time in millis to delay- Parameters:
delay
- delay time in millis- Returns:
- the builder
-
callerRunsWhenRejected
public DelayDefinition callerRunsWhenRejected(boolean callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool. Is by default true- Parameters:
callerRunsWhenRejected
- whether or not the caller should run- Returns:
- the builder
-
asyncDelayed
public DelayDefinition asyncDelayed()
Enables asynchronous delay which means the thread will not block while delaying.
-
syncDelayed
public DelayDefinition syncDelayed()
Enables asynchronous delay which means the thread will not block while delaying.
-
executorService
public DelayDefinition executorService(ExecutorService executorService)
To use a custom Thread Pool if asyncDelay has been enabled.- Specified by:
executorService
in interfaceExecutorServiceAwareDefinition<DelayDefinition>
- Parameters:
executorService
- the executor service- Returns:
- the builder
-
executorServiceRef
public DelayDefinition executorServiceRef(String executorServiceRef)
Refers to a custom Thread Pool if asyncDelay has been enabled.- Specified by:
executorServiceRef
in interfaceExecutorServiceAwareDefinition<DelayDefinition>
- Parameters:
executorServiceRef
- reference for aExecutorService
to lookup in theRegistry
- Returns:
- the builder
-
setExpression
public void setExpression(ExpressionDefinition expression)
Expression to define how long time to wait (in millis)- Overrides:
setExpression
in classExpressionNode
-
getAsyncDelayed
public String getAsyncDelayed()
-
setAsyncDelayed
public void setAsyncDelayed(String asyncDelayed)
-
getCallerRunsWhenRejected
public String getCallerRunsWhenRejected()
-
setCallerRunsWhenRejected
public void setCallerRunsWhenRejected(String callerRunsWhenRejected)
-
getExecutorService
public ExecutorService getExecutorService()
- Specified by:
getExecutorService
in interfaceorg.apache.camel.ExecutorServiceAware
-
setExecutorService
public void setExecutorService(ExecutorService executorService)
- Specified by:
setExecutorService
in interfaceorg.apache.camel.ExecutorServiceAware
-
getExecutorServiceRef
public String getExecutorServiceRef()
- Specified by:
getExecutorServiceRef
in interfaceorg.apache.camel.ExecutorServiceAware
-
setExecutorServiceRef
public void setExecutorServiceRef(String executorServiceRef)
- Specified by:
setExecutorServiceRef
in interfaceorg.apache.camel.ExecutorServiceAware
-
-