Package org.apache.camel.processor
Class Splitter
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.AsyncProcessorSupport
-
- org.apache.camel.processor.MulticastProcessor
-
- org.apache.camel.processor.Splitter
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.AsyncProcessor
,org.apache.camel.Navigate<org.apache.camel.Processor>
,org.apache.camel.Processor
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.ErrorHandlerAware
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
,org.apache.camel.spi.RouteIdAware
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
,org.apache.camel.Traceable
public class Splitter extends MulticastProcessor implements org.apache.camel.AsyncProcessor, org.apache.camel.Traceable
Implements a dynamic Splitter pattern where an expression is evaluated to iterate through each of the parts of a message and then each part is then send to some endpoint.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.camel.processor.MulticastProcessor
MulticastProcessor.MulticastReactiveTask, MulticastProcessor.MulticastTask, MulticastProcessor.MulticastTransactedTask
-
-
Field Summary
-
Fields inherited from class org.apache.camel.processor.MulticastProcessor
onPrepare, processorExchangeFactory
-
-
Constructor Summary
Constructors Constructor Description Splitter(org.apache.camel.CamelContext camelContext, org.apache.camel.Route route, org.apache.camel.Expression expression, org.apache.camel.Processor destination, org.apache.camel.AggregationStrategy aggregationStrategy, boolean parallelProcessing, ExecutorService executorService, boolean shutdownExecutorService, boolean streaming, boolean stopOnException, long timeout, org.apache.camel.Processor onPrepare, boolean useSubUnitOfWork, boolean parallelAggregate)
Splitter(org.apache.camel.CamelContext camelContext, org.apache.camel.Route route, org.apache.camel.Expression expression, org.apache.camel.Processor destination, org.apache.camel.AggregationStrategy aggregationStrategy, boolean parallelProcessing, ExecutorService executorService, boolean shutdownExecutorService, boolean streaming, boolean stopOnException, long timeout, org.apache.camel.Processor onPrepare, boolean useSubUnitOfWork, boolean parallelAggregate, String delimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterable<ProcessorExchangePair>
createProcessorExchangePairs(org.apache.camel.Exchange exchange)
protected void
doBuild()
protected void
doInit()
protected Integer
getExchangeIndex(org.apache.camel.Exchange exchange)
org.apache.camel.Expression
getExpression()
String
getTraceLabel()
boolean
process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
protected void
updateNewExchange(org.apache.camel.Exchange exchange, int index, Iterable<ProcessorExchangePair> allPairs, boolean hasNext)
-
Methods inherited from class org.apache.camel.processor.MulticastProcessor
afterSend, beforeSend, createAggregateExecutorService, createProcessorExchangePair, createUnitOfWorkProcessor, doAggregate, doDone, doShutdown, doStart, doStop, getAggregateExecutorService, getAggregationStrategy, getAggregationStrategy, getCamelContext, getErrorHandler, getId, getProcessors, getRouteId, getTimeout, hasNext, isParallelAggregate, isParallelProcessing, isShareUnitOfWork, isStopOnException, isStreaming, next, prepareSharedUnitOfWork, removeAggregationStrategyFromExchange, schedule, schedule, setAggregateExecutorService, setAggregationStrategyOnExchange, setErrorHandler, setId, setRouteId, setToEndpoint, toString, wrapInErrorHandler
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
Splitter
public Splitter(org.apache.camel.CamelContext camelContext, org.apache.camel.Route route, org.apache.camel.Expression expression, org.apache.camel.Processor destination, org.apache.camel.AggregationStrategy aggregationStrategy, boolean parallelProcessing, ExecutorService executorService, boolean shutdownExecutorService, boolean streaming, boolean stopOnException, long timeout, org.apache.camel.Processor onPrepare, boolean useSubUnitOfWork, boolean parallelAggregate)
-
Splitter
public Splitter(org.apache.camel.CamelContext camelContext, org.apache.camel.Route route, org.apache.camel.Expression expression, org.apache.camel.Processor destination, org.apache.camel.AggregationStrategy aggregationStrategy, boolean parallelProcessing, ExecutorService executorService, boolean shutdownExecutorService, boolean streaming, boolean stopOnException, long timeout, org.apache.camel.Processor onPrepare, boolean useSubUnitOfWork, boolean parallelAggregate, String delimiter)
-
-
Method Detail
-
getTraceLabel
public String getTraceLabel()
- Specified by:
getTraceLabel
in interfaceorg.apache.camel.Traceable
- Overrides:
getTraceLabel
in classMulticastProcessor
-
doBuild
protected void doBuild() throws Exception
- Overrides:
doBuild
in classMulticastProcessor
- Throws:
Exception
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classMulticastProcessor
- Throws:
Exception
-
process
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
- Specified by:
process
in interfaceorg.apache.camel.AsyncProcessor
- Overrides:
process
in classMulticastProcessor
-
createProcessorExchangePairs
protected Iterable<ProcessorExchangePair> createProcessorExchangePairs(org.apache.camel.Exchange exchange) throws Exception
- Overrides:
createProcessorExchangePairs
in classMulticastProcessor
- Throws:
Exception
-
updateNewExchange
protected void updateNewExchange(org.apache.camel.Exchange exchange, int index, Iterable<ProcessorExchangePair> allPairs, boolean hasNext)
- Overrides:
updateNewExchange
in classMulticastProcessor
-
getExchangeIndex
protected Integer getExchangeIndex(org.apache.camel.Exchange exchange)
- Overrides:
getExchangeIndex
in classMulticastProcessor
-
getExpression
public org.apache.camel.Expression getExpression()
-
-