@XmlAttribute
private Integer maximumFailoverAttempts;
@Override
protected LoadBalancer createLoadBalancer(RouteContext routeContext) {
FailOverLoadBalancer answer;
if (!exceptions.isEmpty()) {
List<Class<?>> classes = new ArrayList<Class<?>>();
for (String name : exceptions) {
Class<?> type = routeContext.getCamelContext().getClassResolver().resolveClass(name);
if (type == null) {
throw new IllegalArgumentException("Cannot find class: " + name + " in the classpath");
}
classes.add(type);
}
answer = new FailOverLoadBalancer(classes);
} else {
answer = new FailOverLoadBalancer();
}
if (getMaximumFailoverAttempts() != null) {
answer.setMaximumFailoverAttempts(getMaximumFailoverAttempts());
}
if (isRoundRobin() != null) {
answer.setRoundRobin(isRoundRobin());
}
return answer;
}