public class LoadBalancerBuilder<T extends Server>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
ZoneAwareLoadBalancer<T> |
buildDynamicServerListLoadBalancer()
|
LoadBalancerExecutor |
buildDynamicServerListLoadBalancerExecutor() |
BaseLoadBalancer |
buildFixedServerListLoadBalancer(java.util.List<T> servers) |
LoadBalancerExecutor |
buildFixedServerListLoadBalancerExecutor(java.util.List<T> servers) |
ILoadBalancer |
buildLoadBalancerFromConfigWithReflection()
Build a load balancer using the configuration from the
IClientConfig only. |
static <T extends Server> |
newBuilder() |
LoadBalancerBuilder<T> |
withClientConfig(com.netflix.client.config.IClientConfig config) |
LoadBalancerBuilder<T> |
withDynamicServerList(ServerList<T> serverListImpl) |
LoadBalancerBuilder<T> |
withLoadBalancerExecutorRetryHandler(com.netflix.client.RetryHandler errorHandler) |
LoadBalancerBuilder<T> |
withPing(IPing ping) |
LoadBalancerBuilder<T> |
withRule(IRule rule) |
LoadBalancerBuilder<T> |
withServerListFilter(ServerListFilter<T> serverListFilter) |
public static <T extends Server> LoadBalancerBuilder<T> newBuilder()
public LoadBalancerBuilder<T> withClientConfig(com.netflix.client.config.IClientConfig config)
public LoadBalancerBuilder<T> withLoadBalancerExecutorRetryHandler(com.netflix.client.RetryHandler errorHandler)
public LoadBalancerBuilder<T> withRule(IRule rule)
public LoadBalancerBuilder<T> withPing(IPing ping)
public LoadBalancerBuilder<T> withDynamicServerList(ServerList<T> serverListImpl)
public LoadBalancerBuilder<T> withServerListFilter(ServerListFilter<T> serverListFilter)
public BaseLoadBalancer buildFixedServerListLoadBalancer(java.util.List<T> servers)
public ZoneAwareLoadBalancer<T> buildDynamicServerListLoadBalancer()
ZoneAwareLoadBalancer with a dynamic ServerList and an IRule. The ServerList can be
either set in the withDynamicServerList(ServerList) or in the IClientConfig using CommonClientConfigKey.NIWSServerListClassName.
The IRule can be either set by withRule(IRule) or in the IClientConfig using
CommonClientConfigKey.NFLoadBalancerRuleClassName.public ILoadBalancer buildLoadBalancerFromConfigWithReflection()
IClientConfig only. It uses reflection to initialize necessary load balancer
components.public LoadBalancerExecutor buildDynamicServerListLoadBalancerExecutor()
public LoadBalancerExecutor buildFixedServerListLoadBalancerExecutor(java.util.List<T> servers)