com.netflix.loadbalancer
Class RetryRule

java.lang.Object
  extended by com.netflix.loadbalancer.AbstractLoadBalancerRule
      extended by com.netflix.loadbalancer.RetryRule
All Implemented Interfaces:
com.netflix.client.IClientConfigAware, IRule

public class RetryRule
extends AbstractLoadBalancerRule

Given that IRule can be cascaded, this RetryRule class allows adding a retry logic to an existing Rule.


Constructor Summary
RetryRule()
           
RetryRule(IRule subRule)
           
RetryRule(IRule subRule, long maxRetryMillis)
           
 
Method Summary
 Server choose(ILoadBalancer lb, java.lang.Object key)
           
 Server choose(java.lang.Object key)
           
 long getMaxRetryMillis()
           
 IRule getRule()
           
 void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)
           
 void setLoadBalancer(ILoadBalancer lb)
           
 void setMaxRetryMillis(long maxRetryMillis)
           
 void setRule(IRule subRule)
           
 
Methods inherited from class com.netflix.loadbalancer.AbstractLoadBalancerRule
getLoadBalancer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryRule

public RetryRule()

RetryRule

public RetryRule(IRule subRule)

RetryRule

public RetryRule(IRule subRule,
                 long maxRetryMillis)
Method Detail

setRule

public void setRule(IRule subRule)

getRule

public IRule getRule()

setMaxRetryMillis

public void setMaxRetryMillis(long maxRetryMillis)

getMaxRetryMillis

public long getMaxRetryMillis()

setLoadBalancer

public void setLoadBalancer(ILoadBalancer lb)
Specified by:
setLoadBalancer in interface IRule
Overrides:
setLoadBalancer in class AbstractLoadBalancerRule

choose

public Server choose(ILoadBalancer lb,
                     java.lang.Object key)

choose

public Server choose(java.lang.Object key)

initWithNiwsConfig

public void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)