public void process(Exchange exchange) throws Exception {
AggregationStrategy strategy = getAggregationStrategy();
// if original aggregation strategy then store exchange
// on it as the original exchange
UseOriginalAggregationStrategy original = null;
if (strategy instanceof UseOriginalAggregationStrategy) {
original = (UseOriginalAggregationStrategy) strategy;
original.setOriginal(exchange);
}
super.process(exchange);
if (original != null) {
// and remove the reference when we are done (due to thread local stuff)
original.setOriginal(null);
}
}