org.apache.camel.model
Class SplitDefinition

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

public class SplitDefinition
extends ExpressionNode
implements ExecutorServiceAwareDefinition<SplitDefinition>

Represents an XML <split/> element

Version:

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler, log
 
Constructor Summary
SplitDefinition()
           
SplitDefinition(Expression expression)
           
SplitDefinition(ExpressionDefinition expression)
           
 
Method Summary
 SplitDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
          Set the aggregationStrategy
 SplitDefinition aggregationStrategyRef(String aggregationStrategyRef)
          Set the aggregationStrategy
 Processor createProcessor(RouteContext routeContext)
          Override this in definition class and implement logic to create the processor based on the definition model.
 SplitDefinition executorService(ExecutorService executorService)
          Setting the executor service for executing
 SplitDefinition executorServiceRef(String executorServiceRef)
          Setting the executor service for executing
 AggregationStrategy getAggregationStrategy()
           
 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
 Processor getOnPrepare()
           
 String getOnPrepareRef()
           
 Boolean getParallelProcessing()
           
 Boolean getShareUnitOfWork()
           
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 Boolean getStopOnException()
           
 String getStrategyRef()
           
 Boolean getStreaming()
           
 Long getTimeout()
           
 boolean isParallelProcessing()
           
 boolean isShareUnitOfWork()
           
 Boolean isStopOnException()
           
 boolean isStreaming()
          The splitter should use streaming -- exchanges are being sent as the data for them becomes available.
 SplitDefinition onPrepare(Processor onPrepare)
          Uses the Processor when preparing the Exchange to be send.
 SplitDefinition onPrepareRef(String onPrepareRef)
          Uses the Processor when preparing the Exchange to be send.
 SplitDefinition parallelProcessing()
          Doing the splitting work in parallel
 void setAggregationStrategy(AggregationStrategy aggregationStrategy)
           
 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 setOnPrepare(Processor onPrepare)
           
 void setOnPrepareRef(String onPrepareRef)
           
 void setParallelProcessing(Boolean parallelProcessing)
           
 void setShareUnitOfWork(Boolean shareUnitOfWork)
           
 void setStopOnException(Boolean stopOnException)
           
 void setStrategyRef(String strategyRef)
           
 void setStreaming(Boolean streaming)
           
 void setTimeout(Long timeout)
           
 SplitDefinition shareUnitOfWork()
          Shares the UnitOfWork with the parent and each of the sub messages.
 SplitDefinition stopOnException()
          Will now stop further processing if an exception or failure occurred during processing of an Exchange and the caused exception will be thrown.
 SplitDefinition streaming()
          Enables streaming.
 SplitDefinition timeout(long timeout)
          Sets a timeout value in millis to use when using parallelProcessing.
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ExpressionNode
configureChild, createFilterProcessor, createPredicate, getExpression, getOutputs, isOutputSupported, preCreateProcessor, setExpression, setOutputs
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, enrich, enrich, enrichRef, filter, filter, filter, filter, getInterceptStrategies, getNodeFactory, getOtherAttributes, 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, 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, pollEnrich, pollEnrich, pollEnrichRef, 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, setNodeFactory, 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, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplitDefinition

public SplitDefinition()

SplitDefinition

public SplitDefinition(Expression expression)

SplitDefinition

public SplitDefinition(ExpressionDefinition expression)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

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

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

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

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

aggregationStrategy

public SplitDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
Set the aggregationStrategy

Returns:
the builder

aggregationStrategyRef

public SplitDefinition aggregationStrategyRef(String aggregationStrategyRef)
Set the aggregationStrategy

Parameters:
aggregationStrategyRef - a reference to a strategy to lookup
Returns:
the builder

parallelProcessing

public SplitDefinition parallelProcessing()
Doing the splitting work in parallel

Returns:
the builder

streaming

public SplitDefinition streaming()
Enables streaming. See isStreaming() for more information

Returns:
the builder

stopOnException

public SplitDefinition stopOnException()
Will now stop further processing if an exception or failure occurred during processing of an Exchange and the caused exception will be thrown.

Will also stop if processing the exchange failed (has a fault message) or an exception was thrown and handled by the error handler (such as using onException). In all situations the splitter will stop further processing. This is the same behavior as in pipeline, which is used by the routing engine.

The default behavior is to not stop but continue processing till the end

Returns:
the builder

executorService

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

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

executorServiceRef

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

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

onPrepare

public SplitDefinition onPrepare(Processor onPrepare)
Uses the Processor when preparing the Exchange to be send. This can be used to deep-clone messages that should be send, or any custom logic needed before the exchange is send.

Parameters:
onPrepare - the processor
Returns:
the builder

onPrepareRef

public SplitDefinition onPrepareRef(String onPrepareRef)
Uses the Processor when preparing the Exchange to be send. This can be used to deep-clone messages that should be send, or any custom logic needed before the exchange is send.

Parameters:
onPrepareRef - reference to the processor to lookup in the Registry
Returns:
the builder

timeout

public SplitDefinition timeout(long timeout)
Sets a timeout value in millis to use when using parallelProcessing.

Parameters:
timeout - timeout in millis
Returns:
the builder

shareUnitOfWork

public SplitDefinition shareUnitOfWork()
Shares the UnitOfWork with the parent and each of the sub messages.

Returns:
the builder.
See Also:
SubUnitOfWork

getAggregationStrategy

public AggregationStrategy getAggregationStrategy()

setAggregationStrategy

public void setAggregationStrategy(AggregationStrategy aggregationStrategy)

getParallelProcessing

public Boolean getParallelProcessing()

setParallelProcessing

public void setParallelProcessing(Boolean parallelProcessing)

isParallelProcessing

public boolean isParallelProcessing()

getStreaming

public Boolean getStreaming()

setStreaming

public void setStreaming(Boolean streaming)

isStreaming

public boolean isStreaming()
The splitter should use streaming -- exchanges are being sent as the data for them becomes available. This improves throughput and memory usage, but it has a drawback: - the sent exchanges will no longer contain the Exchange.SPLIT_SIZE header property

Returns:
whether or not streaming should be used

getStopOnException

public Boolean getStopOnException()

setStopOnException

public void setStopOnException(Boolean stopOnException)

isStopOnException

public Boolean isStopOnException()

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

getStrategyRef

public String getStrategyRef()

setStrategyRef

public void setStrategyRef(String strategyRef)

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

getTimeout

public Long getTimeout()

setTimeout

public void setTimeout(Long timeout)

getOnPrepareRef

public String getOnPrepareRef()

setOnPrepareRef

public void setOnPrepareRef(String onPrepareRef)

getOnPrepare

public Processor getOnPrepare()

setOnPrepare

public void setOnPrepare(Processor onPrepare)

getShareUnitOfWork

public Boolean getShareUnitOfWork()

setShareUnitOfWork

public void setShareUnitOfWork(Boolean shareUnitOfWork)

isShareUnitOfWork

public boolean isShareUnitOfWork()


Apache CAMEL