org.apache.camel.processor.aggregate
Class GroupedExchangeAggregationStrategy
java.lang.Object
org.apache.camel.processor.aggregate.AbstractListAggregationStrategy<Exchange>
org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy
- All Implemented Interfaces:
- AggregationStrategy, CompletionAwareAggregationStrategy
public class GroupedExchangeAggregationStrategy
- extends AbstractListAggregationStrategy<Exchange>
Aggregate all exchanges into a single combined Exchange holding all the aggregated exchanges
in a List
as the message body.
- Version:
Method Summary |
Exchange |
aggregate(Exchange oldExchange,
Exchange newExchange)
This method will aggregate the old and new exchange and return the result. |
Exchange |
getValue(Exchange exchange)
This method is implemented by the sub-class and is called to retrieve
an instance of the value that will be aggregated and forwarded to the
receiving end point. |
void |
onCompletion(Exchange exchange)
The aggregated Exchange has completed
Important: This method must not throw any exceptions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GroupedExchangeAggregationStrategy
public GroupedExchangeAggregationStrategy()
onCompletion
public void onCompletion(Exchange exchange)
- Description copied from interface:
CompletionAwareAggregationStrategy
- The aggregated
Exchange
has completed
Important: This method must not throw any exceptions.
- Specified by:
onCompletion
in interface CompletionAwareAggregationStrategy
- Overrides:
onCompletion
in class AbstractListAggregationStrategy<Exchange>
- Parameters:
exchange
- the current aggregated exchange, or the original Exchange
if no aggregation
has been done before the completion occurred
aggregate
public Exchange aggregate(Exchange oldExchange,
Exchange newExchange)
- Description copied from class:
AbstractListAggregationStrategy
- This method will aggregate the old and new exchange and return the result.
- Specified by:
aggregate
in interface AggregationStrategy
- Overrides:
aggregate
in class AbstractListAggregationStrategy<Exchange>
- Parameters:
oldExchange
- The oldest exchange, can be nullnewExchange
- The newest exchange, can be null
- Returns:
- a composite exchange of the old and/or new exchanges
getValue
public Exchange getValue(Exchange exchange)
- Description copied from class:
AbstractListAggregationStrategy
- This method is implemented by the sub-class and is called to retrieve
an instance of the value that will be aggregated and forwarded to the
receiving end point.
If null is returned, then the value is not added to the
List
.
- Specified by:
getValue
in class AbstractListAggregationStrategy<Exchange>
- Parameters:
exchange
- The exchange that is used to retrieve the value from
- Returns:
- An instance of V that is the associated value of the passed exchange
Apache Camel