org.apache.camel.model
Class DelayDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedDefinition
      extended by org.apache.camel.model.ProcessorDefinition<ExpressionNode>
          extended by org.apache.camel.model.ExpressionNode
              extended by org.apache.camel.model.DelayDefinition
All Implemented Interfaces:
ExecutorServiceAware, Block, ExecutorServiceAwareDefinition<DelayDefinition>

public class DelayDefinition
extends ExpressionNode
implements ExecutorServiceAwareDefinition<DelayDefinition>

Represents an XML <delay/> element

Version:
$Revision: 20175 $

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
errorHandlerBuilder, errorHandlerRef, inheritErrorHandler, log
 
Constructor Summary
DelayDefinition()
           
DelayDefinition(Expression delay)
           
 
Method Summary
 DelayDefinition asyncDelayed()
          Enables asynchronous delay which means the thread will noy block while delaying.
 DelayDefinition 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.
 DelayDefinition delayTime(Long delay)
          Sets the delay time in millis to delay
 DelayDefinition executorService(ExecutorService executorService)
          Setting the executor service for executing
 DelayDefinition executorServiceRef(String executorServiceRef)
          Setting the executor service for executing
 Boolean getAsyncDelayed()
           
 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.
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 void setAsyncDelayed(Boolean asyncDelayed)
           
 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.
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ExpressionNode
createFilterProcessor, getExpression, getOutputs, setExpression, setOutputs
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, end, enrich, enrich, enrichRef, filter, filter, filter, filter, getErrorHandlerBuilder, getInterceptStrategies, getNodeFactory, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, loadBalance, loadBalance, log, log, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, process, processRef, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeProperty, resequence, resequence, resequence, resequence, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, setBody, setBody, setErrorHandlerBuilder, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, threads, threads, threads, 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, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getDescription, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelayDefinition

public DelayDefinition()

DelayDefinition

public DelayDefinition(Expression delay)
Method Detail

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

Overrides:
getLabel in class ExpressionNode

getShortName

public String getShortName()
Description copied from class: OptionalIdentifiedDefinition
Returns a short name for this node which can be useful for ID generation or referring to related resources like images

Overrides:
getShortName in class ExpressionNode
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

toString

public String toString()
Overrides:
toString in class Object

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Description copied from class: ProcessorDefinition
Override this in definition class and implement logic to create the processor based on the definition model.

Overrides:
createProcessor in class ProcessorDefinition<ExpressionNode>
Throws:
Exception

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 noy block while delaying.

Returns:
the builder

executorService

public DelayDefinition executorService(ExecutorService executorService)
Description copied from interface: ExecutorServiceAwareDefinition
Setting the executor service for executing

Specified by:
executorService in interface ExecutorServiceAwareDefinition<DelayDefinition>
Parameters:
executorService - the executor service
Returns:
the builder

executorServiceRef

public DelayDefinition executorServiceRef(String executorServiceRef)
Description copied from interface: ExecutorServiceAwareDefinition
Setting the executor service for executing

Specified by:
executorServiceRef in interface ExecutorServiceAwareDefinition<DelayDefinition>
Parameters:
executorServiceRef - reference for a ExecutorService to lookup in the Registry
Returns:
the builder

getAsyncDelayed

public Boolean getAsyncDelayed()

setAsyncDelayed

public void setAsyncDelayed(Boolean asyncDelayed)

getCallerRunsWhenRejected

public Boolean getCallerRunsWhenRejected()

setCallerRunsWhenRejected

public void setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)

getExecutorService

public ExecutorService getExecutorService()
Description copied from interface: ExecutorServiceAware
Gets the executor service

Specified by:
getExecutorService in interface ExecutorServiceAware
Returns:
the executor

setExecutorService

public void setExecutorService(ExecutorService executorService)
Description copied from interface: ExecutorServiceAware
Sets the executor service to be used.

Specified by:
setExecutorService in interface ExecutorServiceAware
Parameters:
executorService - the executor

getExecutorServiceRef

public String getExecutorServiceRef()
Description copied from interface: ExecutorServiceAware
Gets the reference to lookup in the Registry for the executor service to be used.

Specified by:
getExecutorServiceRef in interface ExecutorServiceAware
Returns:
the reference, or null if the executor was set directly

setExecutorServiceRef

public void setExecutorServiceRef(String executorServiceRef)
Description copied from interface: ExecutorServiceAware
Sets a reference to lookup in the Registry for the executor service to be used.

Specified by:
setExecutorServiceRef in interface ExecutorServiceAware
Parameters:
executorServiceRef - reference for the executor


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.