Class DelayDefinition

All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, 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
  • Constructor Details

    • DelayDefinition

      public DelayDefinition()
    • DelayDefinition

      public DelayDefinition(org.apache.camel.Expression delay)
  • Method Details

    • getShortName

      public String getShortName()
      Specified by:
      getShortName in interface org.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 interface org.apache.camel.NamedNode
      Overrides:
      getLabel in class ExpressionNode
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
    • callerRunsWhenRejected

      public DelayDefinition callerRunsWhenRejected(String 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.
    • asyncDelayed

      public DelayDefinition asyncDelayed(String 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 interface ExecutorServiceAwareDefinition<DelayDefinition>
      Parameters:
      executorService - the executor service
      Returns:
      the builder
    • executorService

      public DelayDefinition executorService(String executorService)
      Refers to a custom Thread Pool if asyncDelay has been enabled.
      Specified by:
      executorService in interface ExecutorServiceAwareDefinition<DelayDefinition>
      Parameters:
      executorService - reference for a ExecutorService to lookup in the Registry
      Returns:
      the builder
    • getExecutorServiceBean

      public ExecutorService getExecutorServiceBean()
      Description copied from interface: ExecutorServiceAwareDefinition
      Gets the executor service for executing
      Specified by:
      getExecutorServiceBean in interface ExecutorServiceAwareDefinition<DelayDefinition>
    • getExecutorServiceRef

      public String getExecutorServiceRef()
      Description copied from interface: ExecutorServiceAwareDefinition
      Gets a reference id to lookup the executor service from the registry
      Specified by:
      getExecutorServiceRef in interface ExecutorServiceAwareDefinition<DelayDefinition>
    • setExpression

      public void setExpression(ExpressionDefinition expression)
      Expression to define how long time to wait (in millis)
      Overrides:
      setExpression in class ExpressionNode
    • getAsyncDelayed

      public String getAsyncDelayed()
    • setAsyncDelayed

      public void setAsyncDelayed(String asyncDelayed)
    • getCallerRunsWhenRejected

      public String getCallerRunsWhenRejected()
    • setCallerRunsWhenRejected

      public void setCallerRunsWhenRejected(String callerRunsWhenRejected)
    • getExecutorService

      public String getExecutorService()
    • setExecutorService

      public void setExecutorService(String executorService)