org.apache.camel.model
Class SplitDefinition

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.SplitDefinition
All Implemented Interfaces:
ExecutorServiceAware, Block, ExecutorServiceAwareDefinition<SplitDefinition>

public class SplitDefinition
extends ExpressionNode
implements ExecutorServiceAwareDefinition<SplitDefinition>

Represents an XML <split/> element

Version:
$Revision: 20740 $

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
errorHandlerBuilder, errorHandlerRef, 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
 ExpressionClause<SplitDefinition> expression()
          Set the expression that the splitter will use
 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
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 String getStrategyRef()
           
 Long getTimeout()
           
 boolean isParallelProcessing()
           
 Boolean isStopOnException()
           
 boolean isStreaming()
          The splitter should use streaming -- exchanges are being sent as the data for them becomes available.
 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 setParallelProcessing(boolean parallelProcessing)
           
 void setStopOnException(Boolean stopOnException)
           
 void setStrategyRef(String strategyRef)
           
 void setStreaming(boolean streaming)
           
 void setTimeout(Long timeout)
           
 SplitDefinition stopOnException()
          Will now stop further processing if an exception 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
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, dynamicRouter, dynamicRouter, 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, 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, resolvePropertyPlaceholders, 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, 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

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

expression

public ExpressionClause<SplitDefinition> expression()
Set the expression that the splitter will use

Returns:
the builder

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 setStreaming(boolean) for more information

Returns:
the builder

stopOnException

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

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

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

getAggregationStrategy

public AggregationStrategy getAggregationStrategy()

setAggregationStrategy

public void setAggregationStrategy(AggregationStrategy aggregationStrategy)

isParallelProcessing

public boolean isParallelProcessing()

setParallelProcessing

public void setParallelProcessing(boolean parallelProcessing)

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

setStreaming

public void setStreaming(boolean streaming)

isStopOnException

public Boolean isStopOnException()

setStopOnException

public void setStopOnException(Boolean stopOnException)

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)


Apache CAMEL