return loadBalancer;
}
@Override
public Processor createProcessor(RouteContext routeContext) throws Exception {
LoadBalancer loadBalancer = LoadBalancerDefinition.getLoadBalancer(routeContext, loadBalancerType, ref);
for (ProcessorDefinition<?> processorType : getOutputs()) {
// output must not be another load balancer
// check for instanceof as the code below as there is compilation errors on earlier versions of JDK6
// on Windows boxes or with IBM JDKs etc.
if (LoadBalanceDefinition.class.isInstance(processorType)) {
throw new IllegalArgumentException("Loadbalancer already configured to: " + loadBalancerType + ". Cannot set it to: " + processorType);
}
Processor processor = createProcessor(routeContext, processorType);
processor = wrapChannel(routeContext, processor, processorType);
loadBalancer.addProcessor(processor);
}
return loadBalancer;
}