public abstract class AbstractListAggregationStrategy<V> extends Object implements CompletionAwareAggregationStrategy
List
of values defined by the getValue(Exchange)
call.
The combined Exchange will hold all the aggregated exchanges in a List
as a exchange property with the key Exchange.GROUPED_EXCHANGE
.
The method isStoreAsBodyOnCompletion()
determines if the aggregated List
should
be stored on the Message.setBody(Object)
or be kept as a property
on the exchange.
List
on the completed Exchange
.Constructor and Description |
---|
AbstractListAggregationStrategy() |
Modifier and Type | Method and Description |
---|---|
Exchange |
aggregate(Exchange oldExchange,
Exchange newExchange)
This method will aggregate the old and new exchange and return the result.
|
abstract V |
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.
|
boolean |
isStoreAsBodyOnCompletion()
Whether to store the completed aggregated
List as message body, or to keep as property on the exchange. |
void |
onCompletion(Exchange exchange)
The aggregated
Exchange has completed
Important: This method must not throw any exceptions. |
public AbstractListAggregationStrategy()
public abstract V getValue(Exchange exchange)
List
.exchange
- The exchange that is used to retrieve the value frompublic boolean isStoreAsBodyOnCompletion()
List
as message body, or to keep as property on the exchange.
The default behavior is true to store as message body.public void onCompletion(Exchange exchange)
CompletionAwareAggregationStrategy
Exchange
has completed
Important: This method must not throw any exceptions.onCompletion
in interface CompletionAwareAggregationStrategy
exchange
- the current aggregated exchange, or the original Exchange
if no aggregation
has been done before the completion occurredpublic Exchange aggregate(Exchange oldExchange, Exchange newExchange)
aggregate
in interface AggregationStrategy
oldExchange
- The oldest exchange, can be nullnewExchange
- The newest exchange, can be nullApache Camel