com.caucho.cloud.loadbalance
Class LeastConnectionBalanceStrategy

java.lang.Object
  extended by com.caucho.cloud.loadbalance.AbstractLoadBalanceStrategy
      extended by com.caucho.cloud.loadbalance.LeastConnectionBalanceStrategy

public class LeastConnectionBalanceStrategy
extends AbstractLoadBalanceStrategy

Strategy for selecting the next server


Constructor Summary
LeastConnectionBalanceStrategy(LoadBalanceClientGroup clientGroup)
           
 
Method Summary
protected  ClientSocket openBestServer(int startIndex, ClientSocketFactory oldSrun)
          Opens the best load balance server.
 void setConnectionWeight(int weight)
           
 void setCpuWeight(int weight)
           
 
Methods inherited from class com.caucho.cloud.loadbalance.AbstractLoadBalanceStrategy
getClientList, nextRoundRobin, openServer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LeastConnectionBalanceStrategy

public LeastConnectionBalanceStrategy(LoadBalanceClientGroup clientGroup)
Method Detail

setCpuWeight

public void setCpuWeight(int weight)

setConnectionWeight

public void setConnectionWeight(int weight)

openBestServer

protected ClientSocket openBestServer(int startIndex,
                                      ClientSocketFactory oldSrun)
Opens the best load balance server.

Overrides:
openBestServer in class AbstractLoadBalanceStrategy
oldSrun - on failover, the client which failed with 503