org.apache.camel.model
Class MulticastDefinition

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

public class MulticastDefinition
extends OutputDefinition<MulticastDefinition>
implements ExecutorServiceAwareDefinition<MulticastDefinition>

Represents an XML <multicast/> element

Version:

Field Summary
 
Fields inherited from class org.apache.camel.model.OutputDefinition
outputs
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler, log
 
Constructor Summary
MulticastDefinition()
           
 
Method Summary
 MulticastDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
          Set the multicasting aggregationStrategy
 MulticastDefinition aggregationStrategyRef(String aggregationStrategyRef)
          Set the aggregationStrategy
protected  Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list)
          Creates a new instance of some kind of composite processor which defaults to using a Pipeline but derived classes could change the behaviour
 Processor createProcessor(RouteContext routeContext)
          Override this in definition class and implement logic to create the processor based on the definition model.
 MulticastDefinition executorService(ExecutorService executorService)
          Setting the executor service for executing
 MulticastDefinition 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()
           
 MulticastDefinition onPrepare(Processor onPrepare)
          Uses the Processor when preparing the Exchange to be send.
 MulticastDefinition onPrepareRef(String onPrepareRef)
          Uses the Processor when preparing the Exchange to be send.
 MulticastDefinition parallelProcessing()
          Uses the ExecutorService to do the multicasting work
 MulticastDefinition 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)
           
 MulticastDefinition shareUnitOfWork()
          Shares the UnitOfWork with the parent and each of the sub messages.
 MulticastDefinition stopOnException()
          Will now stop further processing if an exception or failure occurred during processing of an Exchange and the caused exception will be thrown.
 MulticastDefinition streaming()
          Aggregates the responses as the are done (e.g.
 MulticastDefinition timeout(long timeout)
          Sets a timeout value in millis to use when using parallelProcessing.
 String toString()
           
 
Methods inherited from class org.apache.camel.model.OutputDefinition
getOutputs, isOutputSupported, 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, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, 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, preCreateProcessor, 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

MulticastDefinition

public MulticastDefinition()
Method Detail

toString

public String toString()
Overrides:
toString in class OutputDefinition<MulticastDefinition>

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 ProcessorDefinition<MulticastDefinition>

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 OutputDefinition<MulticastDefinition>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

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<MulticastDefinition>
Throws:
Exception

aggregationStrategy

public MulticastDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
Set the multicasting aggregationStrategy

Returns:
the builder

aggregationStrategyRef

public MulticastDefinition aggregationStrategyRef(String aggregationStrategyRef)
Set the aggregationStrategy

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

parallelProcessing

public MulticastDefinition parallelProcessing()
Uses the ExecutorService to do the multicasting work

Returns:
the builder

streaming

public MulticastDefinition streaming()
Aggregates the responses as the are done (e.g. out of order sequence)

Returns:
the builder

stopOnException

public MulticastDefinition 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 multicast 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 MulticastDefinition executorService(ExecutorService executorService)
Description copied from interface: ExecutorServiceAwareDefinition
Setting the executor service for executing

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

executorServiceRef

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

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

onPrepare

public MulticastDefinition 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 MulticastDefinition 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 MulticastDefinition timeout(long timeout)
Sets a timeout value in millis to use when using parallelProcessing.

Parameters:
timeout - timeout in millis
Returns:
the builder

shareUnitOfWork

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

Returns:
the builder.
See Also:
SubUnitOfWork

createCompositeProcessor

protected Processor createCompositeProcessor(RouteContext routeContext,
                                             List<Processor> list)
                                      throws Exception
Description copied from class: ProcessorDefinition
Creates a new instance of some kind of composite processor which defaults to using a Pipeline but derived classes could change the behaviour

Overrides:
createCompositeProcessor in class ProcessorDefinition<MulticastDefinition>
Throws:
Exception

getAggregationStrategy

public AggregationStrategy getAggregationStrategy()

setAggregationStrategy

public MulticastDefinition 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()

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