if (strategy == null && strategyRef != null) {
Object aggStrategy = routeContext.lookup(strategyRef, Object.class);
if (aggStrategy instanceof AggregationStrategy) {
strategy = (AggregationStrategy) aggStrategy;
} else if (aggStrategy != null) {
AggregationStrategyBeanAdapter adapter = new AggregationStrategyBeanAdapter(aggStrategy, getAggregationStrategyMethodName());
if (getStrategyMethodAllowNull() != null) {
adapter.setAllowNullNewExchange(getStrategyMethodAllowNull());
adapter.setAllowNullOldExchange(getStrategyMethodAllowNull());
}
strategy = adapter;
} else {
throw new IllegalArgumentException("Cannot find AggregationStrategy in Registry with name: " + strategyRef);
}