LoadBalanceStrategy createLoadBalancer(String strategy) {
if (RoundRobinStrategy.class.getSimpleName().equals(strategy)) {
return new RoundRobinStrategy();
} else if (RandomStrategy.class.getSimpleName().equals(strategy)) {
return new RandomStrategy();
} else {
try {
Class<?> strategyClass = Class.forName(strategy);
if (!LoadBalanceStrategy.class.isAssignableFrom(strategyClass)) {
throw SCAMessages.MESSAGES.loadBalanceClassDoesNotImplementLoadBalanceStrategy(strategy);