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