org.apache.camel.model
Class ProcessorType<Type extends ProcessorType>

java.lang.Object
  extended by org.apache.camel.model.ProcessorType<Type>
All Implemented Interfaces:
Block
Direct Known Subclasses:
CatchType, ChoiceType, ConvertBodyType, ExceptionType, ExpressionNode, OutputType, ResequencerType, RouteType, RoutingSlipType, ThreadType, ThrottlerType, ThrowFaultType, ToType

public abstract class ProcessorType<Type extends ProcessorType>
extends Object
implements Block

Version:
$Revision: 41168 $

Field Summary
static String DEFAULT_TRACE_CATEGORY
           
 
Constructor Summary
ProcessorType()
           
 
Method Summary
 void addInterceptor(InterceptorType interceptor)
           
 void addOutput(ProcessorType processorType)
           
 void addRoutes(RouteContext routeContext, Collection<Route> routes)
           
 ExpressionClause<AggregatorType> aggregator()
          Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.
 ExpressionClause<AggregatorType> aggregator(AggregationCollection aggregationCollection)
          Creates an Aggregator pattern using a custom aggregation collection implementation.
 ExpressionClause<AggregatorType> aggregator(AggregationStrategy aggregationStrategy)
          Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.
 AggregatorType aggregator(Expression correlationExpression)
          Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.
 AggregatorType aggregator(Expression correlationExpression, AggregationStrategy aggregationStrategy)
          Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.
 Type bean(Class beanType)
          Adds a bean by type which is invoked which could be a final destination, or could be a transformation in a pipeline
 Type bean(Class beanType, String method)
          Adds a bean type and method which is invoked which could be a final destination, or could be a transformation in a pipeline
 Type bean(Object bean)
          Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
 Type bean(Object bean, String method)
          Adds a bean and method which is invoked which could be a final destination, or could be a transformation in a pipeline
 Type beanRef(String ref)
          Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
 Type beanRef(String ref, String method)
          Adds a bean and method which is invoked which could be a final destination, or could be a transformation in a pipeline
 ChoiceType choice()
          Creates a choice of one or more predicates with an otherwise clause
 void clearOutput()
           
protected  void configureChild(ProcessorType output)
           
 Type convertBodyTo(Class type)
          Converts the IN message body to the specified type
 Type convertFaultBodyTo(Class type)
          Converts the FAULT message body to the specified type
 Type convertOutBodyTo(Class type)
          Deprecated. Please use convertBodyTo(Class) instead
protected  Processor createCompositeProcessor(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
protected  ErrorHandlerBuilder createErrorHandlerBuilder()
           
 Processor createOutputsProcessor(RouteContext routeContext)
           
protected  Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorType<?>> outputs)
           
 Processor createProcessor(RouteContext routeContext)
           
 ExpressionClause<DelayerType> delayer()
          Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on
 DelayerType delayer(Expression<Exchange> processAtExpression)
          Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on
 DelayerType delayer(Expression<Exchange> processAtExpression, long delay)
          Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on
 DelayerType delayer(long delay)
          Creates the Delayer pattern where a fixed amount of milliseconds are used to delay processing of a message exchange
 ProcessorType<? extends ProcessorType> end()
          Ends the current block
 Type errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
          Installs the given error handler builder
 ExceptionType exception(Class exceptionType)
           
 ExpressionClause<FilterType> filter()
          Creates a predicate expression which only if it is true then the exchange is forwarded to the destination
 FilterType filter(ExpressionType expression)
           
 FilterType filter(Predicate predicate)
          Creates a predicate which is applied and only if it is true then the exchange is forwarded to the destination
 FilterType filter(String language, String expression)
           
 ErrorHandlerBuilder getErrorHandlerBuilder()
           
 Boolean getInheritErrorHandlerFlag()
           
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 NodeFactory getNodeFactory()
           
abstract  List<ProcessorType<?>> getOutputs()
           
 ProcessorType<? extends ProcessorType> getParent()
           
 Type handleFault()
          Forces handling of faults as exceptions
 IdempotentConsumerType idempotentConsumer(Expression messageIdExpression, MessageIdRepository messageIdRepository)
          Creates an IdempotentConsumer to avoid duplicate messages
 ExpressionClause<IdempotentConsumerType> idempotentConsumer(MessageIdRepository messageIdRepository)
          Creates an IdempotentConsumer to avoid duplicate messages
 Type inheritErrorHandler(boolean condition)
          Configures whether or not the error handler is inherited by every processing node (or just the top most one)
 InterceptType intercept()
           
 Type intercept(DelegateProcessor interceptor)
           
 ChoiceType intercept(Predicate predicate)
          Apply an interceptor route if the predicate is true
 Type interceptor(String ref)
           
 Type interceptors(String... refs)
           
 boolean isInheritErrorHandler()
           
 LoadBalanceType loadBalance()
           
protected  Processor makeProcessor(RouteContext routeContext)
          Creates the processor and wraps it in any necessary interceptors and error handlers
 DataFormatClause<ProcessorType<Type>> marshal()
          Marshals the in body using a DataFormat expression to define the format of the output which will be added to the out body.
 Type marshal(DataFormat dataFormat)
          Marshals the in body using the specified DataFormat and sets the output on the out message body.
 Type marshal(DataFormatType dataFormatType)
          Marshals the in body using the specified DataFormat and sets the output on the out message body.
 Type marshal(String dataTypeRef)
          Marshals the in body the specified DataFormat reference in the Registry and sets the output on the out message body.
 MulticastType multicast()
          Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.
 MulticastType multicast(AggregationStrategy aggregationStrategy)
          Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.
 MulticastType multicast(AggregationStrategy aggregationStrategy, boolean parallelProcessing)
          Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.
 Type pipeline(Collection<Endpoint> endpoints)
          Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint
 Type pipeline(Endpoint... endpoints)
          Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint
 Type pipeline(String... uris)
          Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint
 PolicyRef policies()
           
 PolicyRef policy(Policy policy)
           
protected  Block popBlock()
           
 Type proceed()
           
 Type process(Processor processor)
          Adds the custom processor to this destination which could be a final destination, or could be a transformation in a pipeline
 Type processRef(String ref)
          Adds the custom processor reference to this destination which could be a final destination, or could be a transformation in a pipeline
protected  void pushBlock(Block block)
           
 ExpressionClause<ProcessorType<Type>> recipientList()
          Creates a dynamic Recipient List pattern.
 Type recipientList(Expression receipients)
          Creates a dynamic Recipient List pattern.
 Type removeFaultHeader(String name)
          Adds a processor which removes the header on the FAULT message
 Type removeHeader(String name)
          Adds a processor which removes the header on the IN message
 Type removeOutHeader(String name)
          Adds a processor which removes the header on the OUT message
 Type removeProperty(String name)
          Adds a processor which removes the exchange property
 ExpressionClause<ResequencerType> resequencer()
          Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them.
 ResequencerType resequencer(Expression... expressions)
          Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them.
 ResequencerType resequencer(Expression<Exchange> expression)
          Creates the Resequencer pattern where an expression is evaluated to be able to compare the message exchanges to reorder them.
 ResequencerType resequencer(List<Expression> expressions)
          Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them.
 Type routingSlip()
          Creates a Routing Slip pattern with the default header RoutingSlipType.ROUTING_SLIP_HEADER.
 Type routingSlip(String header)
          Creates a Routing Slip pattern.
 Type routingSlip(String header, String uriDelimiter)
          Creates a Routing Slip pattern.
 ExpressionClause<ProcessorType<Type>> setBody()
          Adds a processor which sets the body on the IN message
 Type setBody(Expression expression)
          Adds a processor which sets the body on the IN message
 void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
          Sets the error handler to use with processors created by this builder
 Type setFaultBody(Expression expression)
          Adds a processor which sets the body on the FAULT message
 Type setFaultHeader(String name, Expression expression)
          Adds a processor which sets the header on the FAULT message
 ExpressionClause<ProcessorType<Type>> setHeader(String name)
          Adds a processor which sets the header on the IN message
 Type setHeader(String name, Expression expression)
          Adds a processor which sets the header on the IN message
 Type setHeader(String name, String value)
          Adds a processor which sets the header on the IN message to the given value
 void setInheritErrorHandlerFlag(Boolean inheritErrorHandlerFlag)
           
 void setNodeFactory(NodeFactory nodeFactory)
           
 ExpressionClause<ProcessorType<Type>> setOutBody()
          Deprecated. Please use transform() instead
 Type setOutBody(Expression expression)
          Deprecated. Please use transform(Expression) instead
 ExpressionClause<ProcessorType<Type>> setOutHeader(String name)
          Adds a processor which sets the header on the OUT message
 Type setOutHeader(String name, Expression expression)
          Adds a processor which sets the header on the OUT message
 Type setOutHeader(String name, String value)
          Adds a processor which sets the header on the OUT message
 void setParent(ProcessorType<? extends ProcessorType> parent)
           
 ExpressionClause<ProcessorType<Type>> setProperty(String name)
          Adds a processor which sets the exchange property
 Type setProperty(String name, Expression expression)
          Adds a processor which sets the exchange property
 ExpressionClause<SplitterType> splitter()
          Creates the 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.
 ExpressionClause<SplitterType> splitter(AggregationStrategy aggregationStrategy)
          Creates the 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.
 ExpressionClause<SplitterType> splitter(AggregationStrategy aggregationStrategy, boolean parallelProcessing)
          Creates the 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.
 ExpressionClause<SplitterType> splitter(boolean parallelProcessing)
          Creates the 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.
 SplitterType splitter(Expression receipients)
          Creates the 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.
 SplitterType splitter(Expression partsExpression, AggregationStrategy aggregationStrategy)
          Creates the 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.
 SplitterType splitter(Expression partsExpression, AggregationStrategy aggregationStrategy, boolean parallelProcessing)
          Creates the 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.
 SplitterType splitter(Expression receipients, boolean parallelProcessing)
          Creates the 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.
 ThreadType thread(int coreSize)
          Causes subsequent processors to be called asynchronously
 ProcessorType<Type> thread(ThreadPoolExecutor executor)
          Causes subsequent processors to be called asynchronously
 ThrottlerType throttler(long maximumRequestCount)
          Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on
 Type throwFault(String message)
           
 Type throwFault(Throwable fault)
           
 Type to(Collection<Endpoint> endpoints)
          Sends the exchange to a list of endpoint using the MulticastProcessor pattern
 Type to(Endpoint... endpoints)
          Sends the exchange to a list of endpoints using the MulticastProcessor pattern
 Type to(Endpoint endpoint)
          Sends the exchange to the given endpoint
 Type to(String... uris)
          Sends the exchange to a list of endpoints using the MulticastProcessor pattern
 Type to(String uri)
          Sends the exchange to the given endpoint URI
 Type trace()
          Trace logs the exchange before it goes to the next processing step using the DEFAULT_TRACE_CATEGORY logging category.
 Type trace(String category)
          Trace logs the exchange before it goes to the next processing step using the specified logging category.
 ExpressionClause<ProcessorType<Type>> transform()
          Adds a processor which sets the body on the OUT message
 Type transform(Expression expression)
          Adds a processor which sets the body on the OUT message
 TryType tryBlock()
          Creates a try/catch block
 DataFormatClause<ProcessorType<Type>> unmarshal()
          Unmarshals the in body using a DataFormat expression to define the format of the input message and the output will be set on the out message body.
 Type unmarshal(DataFormat dataFormat)
          Unmarshals the in body using the specified DataFormat and sets the output on the out message body.
 Type unmarshal(DataFormatType dataFormatType)
          Unmarshals the in body using the specified DataFormat and sets the output on the out message body.
 Type unmarshal(String dataTypeRef)
          Unmarshals the in body using the specified DataFormat reference in the Registry and sets the output on the out message body.
protected  Processor wrapInErrorHandler(Processor processor)
          A strategy method to allow newly created processors to be wrapped in an error handler.
 Processor wrapProcessor(RouteContext routeContext, Processor processor)
          Wraps the child processor in whatever necessary interceptors and error handlers
protected  Processor wrapProcessorInInterceptors(RouteContext routeContext, Processor target)
          A strategy method which allows derived classes to wrap the child processor in some kind of interceptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TRACE_CATEGORY

public static final String DEFAULT_TRACE_CATEGORY
See Also:
Constant Field Values
Constructor Detail

ProcessorType

public ProcessorType()
Method Detail

getOutputs

public abstract List<ProcessorType<?>> getOutputs()

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Throws:
Exception

createOutputsProcessor

public Processor createOutputsProcessor(RouteContext routeContext)
                                 throws Exception
Throws:
Exception

addRoutes

public void addRoutes(RouteContext routeContext,
                      Collection<Route> routes)
               throws Exception
Throws:
Exception

wrapProcessor

public Processor wrapProcessor(RouteContext routeContext,
                               Processor processor)
                        throws Exception
Wraps the child processor in whatever necessary interceptors and error handlers

Throws:
Exception

to

public Type to(String uri)
Sends the exchange to the given endpoint URI


to

public Type to(Endpoint endpoint)
Sends the exchange to the given endpoint


to

public Type to(String... uris)
Sends the exchange to a list of endpoints using the MulticastProcessor pattern


to

public Type to(Endpoint... endpoints)
Sends the exchange to a list of endpoints using the MulticastProcessor pattern


to

public Type to(Collection<Endpoint> endpoints)
Sends the exchange to a list of endpoint using the MulticastProcessor pattern


multicast

public MulticastType multicast()
Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.


multicast

public MulticastType multicast(AggregationStrategy aggregationStrategy,
                               boolean parallelProcessing)
Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.

Parameters:
aggregationStrategy - the strategy used to aggregate responses for every part
parallelProcessing - if is true camel will fork thread to call the endpoint producer
Returns:
the multicast type

multicast

public MulticastType multicast(AggregationStrategy aggregationStrategy)
Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other.

Parameters:
aggregationStrategy - the strategy used to aggregate responses for every part
Returns:
the multicast type

pipeline

public Type pipeline(String... uris)
Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint


pipeline

public Type pipeline(Endpoint... endpoints)
Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint


pipeline

public Type pipeline(Collection<Endpoint> endpoints)
Creates a Pipeline of the list of endpoints so that the message will get processed by each endpoint in turn and for request/response the output of one endpoint will be the input of the next endpoint


end

public ProcessorType<? extends ProcessorType> end()
Ends the current block


thread

public ThreadType thread(int coreSize)
Causes subsequent processors to be called asynchronously

Parameters:
coreSize - the number of threads that will be used to process messages in subsequent processors.
Returns:
a ThreadType builder that can be used to further configure the the thread pool.

thread

public ProcessorType<Type> thread(ThreadPoolExecutor executor)
Causes subsequent processors to be called asynchronously

Parameters:
executor - the executor that will be used to process messages in subsequent processors.
Returns:
a ThreadType builder that can be used to further configure the the thread pool.

idempotentConsumer

public IdempotentConsumerType idempotentConsumer(Expression messageIdExpression,
                                                 MessageIdRepository messageIdRepository)
Creates an IdempotentConsumer to avoid duplicate messages


idempotentConsumer

public ExpressionClause<IdempotentConsumerType> idempotentConsumer(MessageIdRepository messageIdRepository)
Creates an IdempotentConsumer to avoid duplicate messages

Returns:
the builder used to create the expression

filter

public ExpressionClause<FilterType> filter()
Creates a predicate expression which only if it is true then the exchange is forwarded to the destination

Returns:
the clause used to create the filter expression

filter

public FilterType filter(Predicate predicate)
Creates a predicate which is applied and only if it is true then the exchange is forwarded to the destination

Returns:
the builder for a predicate

filter

public FilterType filter(ExpressionType expression)

filter

public FilterType filter(String language,
                         String expression)

loadBalance

public LoadBalanceType loadBalance()

choice

public ChoiceType choice()
Creates a choice of one or more predicates with an otherwise clause

Returns:
the builder for a choice expression

tryBlock

public TryType tryBlock()
Creates a try/catch block

Returns:
the builder for a tryBlock expression

recipientList

public Type recipientList(Expression receipients)
Creates a dynamic Recipient List pattern.

Parameters:
receipients - is the builder of the expression used in the RecipientList to decide the destinations

recipientList

public ExpressionClause<ProcessorType<Type>> recipientList()
Creates a dynamic Recipient List pattern.

Returns:
the expression clause for the expression used in the RecipientList to decide the destinations

routingSlip

public Type routingSlip(String header,
                        String uriDelimiter)
Creates a Routing Slip pattern.

Parameters:
header - is the header that the RoutingSlip class will look in for the list of URIs to route the message to.
uriDelimiter - is the delimiter that will be used to split up the list of URIs in the routing slip.

routingSlip

public Type routingSlip(String header)
Creates a Routing Slip pattern.

Parameters:
header - is the header that the RoutingSlip class will look in for the list of URIs to route the message to. The list of URIs will be split based on the default delimiter RoutingSlipType.DEFAULT_DELIMITER.

routingSlip

public Type routingSlip()
Creates a Routing Slip pattern with the default header RoutingSlipType.ROUTING_SLIP_HEADER. The list of URIs in the header will be split based on the default delimiter RoutingSlipType.DEFAULT_DELIMITER.


splitter

public SplitterType splitter(Expression receipients)
Creates the 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. This splitter responds with the latest message returned from destination endpoint.

Parameters:
receipients - the expression on which to split
Returns:
the builder

splitter

public ExpressionClause<SplitterType> splitter()
Creates the 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. This splitter responds with the latest message returned from destination endpoint.

Returns:
the expression clause for the expression on which to split

splitter

public SplitterType splitter(Expression partsExpression,
                             AggregationStrategy aggregationStrategy)
Creates the 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. Answer from the splitter is produced using given AggregationStrategy

Parameters:
partsExpression - the expression on which to split
aggregationStrategy - the strategy used to aggregate responses for every part
Returns:
the builder

splitter

public ExpressionClause<SplitterType> splitter(AggregationStrategy aggregationStrategy)
Creates the 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. Answer from the splitter is produced using given AggregationStrategy

Parameters:
aggregationStrategy - the strategy used to aggregate responses for every part
Returns:
the expression clause for the expression on which to split

splitter

public SplitterType splitter(Expression receipients,
                             boolean parallelProcessing)
Creates the 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. This splitter responds with the latest message returned from destination endpoint.

Parameters:
receipients - the expression on which to split
parallelProcessing - if is true camel will fork thread to call the endpoint producer
Returns:
the builder

splitter

public ExpressionClause<SplitterType> splitter(boolean parallelProcessing)
Creates the 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. This splitter responds with the latest message returned from destination endpoint.

Parameters:
parallelProcessing - if is true camel will fork thread to call the endpoint producer
Returns:
the expression clause for the expression on which to split

splitter

public SplitterType splitter(Expression partsExpression,
                             AggregationStrategy aggregationStrategy,
                             boolean parallelProcessing)
Creates the 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. Answer from the splitter is produced using given AggregationStrategy

Parameters:
partsExpression - the expression on which to split
aggregationStrategy - the strategy used to aggregate responses for every part
parallelProcessing - if is true camel will fork thread to call the endpoint producer
Returns:
the builder

splitter

public ExpressionClause<SplitterType> splitter(AggregationStrategy aggregationStrategy,
                                               boolean parallelProcessing)
Creates the 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. Answer from the splitter is produced using given AggregationStrategy

Parameters:
aggregationStrategy - the strategy used to aggregate responses for every part
parallelProcessing - if is true camel will fork thread to call the endpoint producer
Returns:
the expression clause for the expression on which to split

resequencer

public ExpressionClause<ResequencerType> resequencer()
Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you may wish to sort by some headers

Returns:
the expression clause for the expressions on which to compare messages in order

resequencer

public ResequencerType resequencer(Expression<Exchange> expression)
Creates the Resequencer pattern where an expression is evaluated to be able to compare the message exchanges to reorder them. e.g. you may wish to sort by some header

Parameters:
expression - the expression on which to compare messages in order
Returns:
the builder

resequencer

public ResequencerType resequencer(List<Expression> expressions)
Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you may wish to sort by some headers

Parameters:
expressions - the expressions on which to compare messages in order
Returns:
the builder

resequencer

public ResequencerType resequencer(Expression... expressions)
Creates the Resequencer pattern where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you may wish to sort by some headers

Parameters:
expressions - the expressions on which to compare messages in order
Returns:
the builder

aggregator

public ExpressionClause<AggregatorType> aggregator()
Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.

A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to throttle it right down so that multiple messages for the same stock are combined (or just the latest message is used and older prices are discarded). Another idea is to combine line item messages together into a single invoice message.


aggregator

public ExpressionClause<AggregatorType> aggregator(AggregationStrategy aggregationStrategy)
Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.

A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to throttle it right down so that multiple messages for the same stock are combined (or just the latest message is used and older prices are discarded). Another idea is to combine line item messages together into a single invoice message.

Parameters:
aggregationStrategy - the strategy used for the aggregation

aggregator

public ExpressionClause<AggregatorType> aggregator(AggregationCollection aggregationCollection)
Creates an Aggregator pattern using a custom aggregation collection implementation.

Parameters:
aggregationCollection - the collection used to perform the aggregation

aggregator

public AggregatorType aggregator(Expression correlationExpression)
Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.

A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to throttle it right down so that multiple messages for the same stock are combined (or just the latest message is used and older prices are discarded). Another idea is to combine line item messages together into a single invoice message.

Parameters:
correlationExpression - the expression used to calculate the correlation key. For a JMS message this could be the expression header("JMSDestination") or header("JMSCorrelationID")

aggregator

public AggregatorType aggregator(Expression correlationExpression,
                                 AggregationStrategy aggregationStrategy)
Creates an Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of AggregationStrategy (by default the latest message is used) to compress many message exchanges into a smaller number of exchanges.

A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to throttle it right down so that multiple messages for the same stock are combined (or just the latest message is used and older prices are discarded). Another idea is to combine line item messages together into a single invoice message.

Parameters:
correlationExpression - the expression used to calculate the correlation key. For a JMS message this could be the expression header("JMSDestination") or header("JMSCorrelationID")

delayer

public DelayerType delayer(Expression<Exchange> processAtExpression)
Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on

Parameters:
processAtExpression - an expression to calculate the time at which the messages should be processed
Returns:
the builder

delayer

public DelayerType delayer(Expression<Exchange> processAtExpression,
                           long delay)
Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on

Parameters:
processAtExpression - an expression to calculate the time at which the messages should be processed
delay - the delay in milliseconds which is added to the processAtExpression to determine the time the message should be processed
Returns:
the builder

delayer

public ExpressionClause<DelayerType> delayer()
Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on

Returns:
the expression clause to create the expression

delayer

public DelayerType delayer(long delay)
Creates the Delayer pattern where a fixed amount of milliseconds are used to delay processing of a message exchange

Parameters:
delay - the default delay in milliseconds
Returns:
the builder

throttler

public ThrottlerType throttler(long maximumRequestCount)
Creates the Delayer pattern where an expression is used to calculate the time which the message will be dispatched on

Returns:
the builder

throwFault

public Type throwFault(Throwable fault)

throwFault

public Type throwFault(String message)

interceptor

public Type interceptor(String ref)

intercept

public Type intercept(DelegateProcessor interceptor)

intercept

public InterceptType intercept()

addInterceptor

public void addInterceptor(InterceptorType interceptor)

pushBlock

protected void pushBlock(Block block)

popBlock

protected Block popBlock()

proceed

public Type proceed()

exception

public ExceptionType exception(Class exceptionType)

intercept

public ChoiceType intercept(Predicate predicate)
Apply an interceptor route if the predicate is true


interceptors

public Type interceptors(String... refs)

trace

public Type trace()
Trace logs the exchange before it goes to the next processing step using the DEFAULT_TRACE_CATEGORY logging category.


trace

public Type trace(String category)
Trace logs the exchange before it goes to the next processing step using the specified logging category.

Parameters:
category - the logging category trace messages will sent to.

policies

public PolicyRef policies()

policy

public PolicyRef policy(Policy policy)

handleFault

public Type handleFault()
Forces handling of faults as exceptions

Returns:
the current builder with the fault handler configured

errorHandler

public Type errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
Installs the given error handler builder

Parameters:
errorHandlerBuilder - the error handler to be used by default for all child routes
Returns:
the current builder with the error handler configured

inheritErrorHandler

public Type inheritErrorHandler(boolean condition)
Configures whether or not the error handler is inherited by every processing node (or just the top most one)

Parameters:
condition - the flag as to whether error handlers should be inherited or not
Returns:
the current builder

process

public Type process(Processor processor)
Adds the custom processor to this destination which could be a final destination, or could be a transformation in a pipeline


processRef

public Type processRef(String ref)
Adds the custom processor reference to this destination which could be a final destination, or could be a transformation in a pipeline


bean

public Type bean(Object bean)
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline


bean

public Type bean(Object bean,
                 String method)
Adds a bean and method which is invoked which could be a final destination, or could be a transformation in a pipeline


bean

public Type bean(Class beanType)
Adds a bean by type which is invoked which could be a final destination, or could be a transformation in a pipeline


bean

public Type bean(Class beanType,
                 String method)
Adds a bean type and method which is invoked which could be a final destination, or could be a transformation in a pipeline


beanRef

public Type beanRef(String ref)
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline


beanRef

public Type beanRef(String ref,
                    String method)
Adds a bean and method which is invoked which could be a final destination, or could be a transformation in a pipeline


setBody

public ExpressionClause<ProcessorType<Type>> setBody()
Adds a processor which sets the body on the IN message


setBody

public Type setBody(Expression expression)
Adds a processor which sets the body on the IN message


setOutBody

public Type setOutBody(Expression expression)
Deprecated. Please use transform(Expression) instead

Adds a processor which sets the body on the OUT message


setOutBody

public ExpressionClause<ProcessorType<Type>> setOutBody()
Deprecated. Please use transform() instead

Adds a processor which sets the body on the OUT message


transform

public Type transform(Expression expression)
Adds a processor which sets the body on the OUT message


transform

public ExpressionClause<ProcessorType<Type>> transform()
Adds a processor which sets the body on the OUT message


setFaultBody

public Type setFaultBody(Expression expression)
Adds a processor which sets the body on the FAULT message


setHeader

public ExpressionClause<ProcessorType<Type>> setHeader(String name)
Adds a processor which sets the header on the IN message


setHeader

public Type setHeader(String name,
                      Expression expression)
Adds a processor which sets the header on the IN message


setHeader

public Type setHeader(String name,
                      String value)
Adds a processor which sets the header on the IN message to the given value


setOutHeader

public ExpressionClause<ProcessorType<Type>> setOutHeader(String name)
Adds a processor which sets the header on the OUT message


setOutHeader

public Type setOutHeader(String name,
                         Expression expression)
Adds a processor which sets the header on the OUT message


setOutHeader

public Type setOutHeader(String name,
                         String value)
Adds a processor which sets the header on the OUT message


setFaultHeader

public Type setFaultHeader(String name,
                           Expression expression)
Adds a processor which sets the header on the FAULT message


setProperty

public Type setProperty(String name,
                        Expression expression)
Adds a processor which sets the exchange property


setProperty

public ExpressionClause<ProcessorType<Type>> setProperty(String name)
Adds a processor which sets the exchange property


removeHeader

public Type removeHeader(String name)
Adds a processor which removes the header on the IN message


removeOutHeader

public Type removeOutHeader(String name)
Adds a processor which removes the header on the OUT message


removeFaultHeader

public Type removeFaultHeader(String name)
Adds a processor which removes the header on the FAULT message


removeProperty

public Type removeProperty(String name)
Adds a processor which removes the exchange property


convertBodyTo

public Type convertBodyTo(Class type)
Converts the IN message body to the specified type


convertOutBodyTo

public Type convertOutBodyTo(Class type)
Deprecated. Please use convertBodyTo(Class) instead

Converts the OUT message body to the specified type


convertFaultBodyTo

public Type convertFaultBodyTo(Class type)
Converts the FAULT message body to the specified type


unmarshal

public DataFormatClause<ProcessorType<Type>> unmarshal()
Unmarshals the in body using a DataFormat expression to define the format of the input message and the output will be set on the out message body.

Returns:
the expression to create the DataFormat

unmarshal

public Type unmarshal(DataFormatType dataFormatType)
Unmarshals the in body using the specified DataFormat and sets the output on the out message body.

Returns:
this object

unmarshal

public Type unmarshal(DataFormat dataFormat)
Unmarshals the in body using the specified DataFormat and sets the output on the out message body.

Returns:
this object

unmarshal

public Type unmarshal(String dataTypeRef)
Unmarshals the in body using the specified DataFormat reference in the Registry and sets the output on the out message body.

Returns:
this object

marshal

public DataFormatClause<ProcessorType<Type>> marshal()
Marshals the in body using a DataFormat expression to define the format of the output which will be added to the out body.

Returns:
the expression to create the DataFormat

marshal

public Type marshal(DataFormatType dataFormatType)
Marshals the in body using the specified DataFormat and sets the output on the out message body.

Returns:
this object

marshal

public Type marshal(DataFormat dataFormat)
Marshals the in body using the specified DataFormat and sets the output on the out message body.

Returns:
this object

marshal

public Type marshal(String dataTypeRef)
Marshals the in body the specified DataFormat reference in the Registry and sets the output on the out message body.

Returns:
this object

getParent

public ProcessorType<? extends ProcessorType> getParent()

setParent

public void setParent(ProcessorType<? extends ProcessorType> parent)

getErrorHandlerBuilder

public ErrorHandlerBuilder getErrorHandlerBuilder()

setErrorHandlerBuilder

public void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Sets the error handler to use with processors created by this builder


isInheritErrorHandler

public boolean isInheritErrorHandler()

getInheritErrorHandlerFlag

public Boolean getInheritErrorHandlerFlag()

setInheritErrorHandlerFlag

public void setInheritErrorHandlerFlag(Boolean inheritErrorHandlerFlag)

getNodeFactory

public NodeFactory getNodeFactory()

setNodeFactory

public void setNodeFactory(NodeFactory nodeFactory)

getLabel

public String getLabel()
Returns a label to describe this node such as the expression if some kind of expression node


makeProcessor

protected Processor makeProcessor(RouteContext routeContext)
                           throws Exception
Creates the processor and wraps it in any necessary interceptors and error handlers

Throws:
Exception

wrapProcessorInInterceptors

protected Processor wrapProcessorInInterceptors(RouteContext routeContext,
                                                Processor target)
                                         throws Exception
A strategy method which allows derived classes to wrap the child processor in some kind of interceptor

Parameters:
routeContext -
target - the processor which can be wrapped
Returns:
the original processor or a new wrapped interceptor
Throws:
Exception

wrapInErrorHandler

protected Processor wrapInErrorHandler(Processor processor)
                                throws Exception
A strategy method to allow newly created processors to be wrapped in an error handler.

Throws:
Exception

createErrorHandlerBuilder

protected ErrorHandlerBuilder createErrorHandlerBuilder()

configureChild

protected void configureChild(ProcessorType output)

addOutput

public void addOutput(ProcessorType processorType)
Specified by:
addOutput in interface Block

createCompositeProcessor

protected Processor createCompositeProcessor(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


createOutputsProcessor

protected Processor createOutputsProcessor(RouteContext routeContext,
                                           Collection<ProcessorType<?>> outputs)
                                    throws Exception
Throws:
Exception

clearOutput

public void clearOutput()


Copyright © 2008 IONA Open Source Community. All Rights Reserved.