com.caucho.cloud.loadbalance
Class LoadBalanceBuilder

java.lang.Object
  extended by com.caucho.cloud.loadbalance.LoadBalanceBuilder
Direct Known Subclasses:
ProLoadBalanceBuilder

public class LoadBalanceBuilder
extends java.lang.Object

LoadBalanceService distributes requests across a group of clients.


Constructor Summary
LoadBalanceBuilder()
           
 
Method Summary
 void addAddress(java.lang.String address)
           
 void addClient(ClientSocketFactory client)
          Adds a client pool factory.
 LoadBalanceManager create()
          Returns the load balance manager.
protected  ClientSocketFactory createClientSocketFactory(java.lang.String address)
           
 java.util.ArrayList<ClientSocketFactory> getClientList()
           
 long getIdleTimeout()
           
 java.lang.String getMeterCategory()
          The statistics meter category.
 LoadBalanceStrategy getStrategy()
          The load balance strategy.
 void setIdleTimeout(long timeout)
           
 void setMeterCategory(java.lang.String category)
          The statistics meter category.
 void setStickyRequestHashGenerator(StickyRequestHashGenerator gen)
          The request-sticky generator
 void setStrategy(LoadBalanceStrategy strategy)
          Sets the load balance strategy.
 void setTargetCluster(CloudPod pod)
          Sets the target cluster by CloudPod id.
 void setTargetCluster(java.lang.String clusterId)
          Sets the target cluster by id.
 void setTargetPort(int port)
          Sets the target cluster by id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadBalanceBuilder

public LoadBalanceBuilder()
Method Detail

setStrategy

public void setStrategy(LoadBalanceStrategy strategy)
Sets the load balance strategy.


getStrategy

public LoadBalanceStrategy getStrategy()
The load balance strategy.


setStickyRequestHashGenerator

public void setStickyRequestHashGenerator(StickyRequestHashGenerator gen)
The request-sticky generator


setIdleTimeout

public void setIdleTimeout(long timeout)

getIdleTimeout

public long getIdleTimeout()

setMeterCategory

public void setMeterCategory(java.lang.String category)
The statistics meter category.


getMeterCategory

public java.lang.String getMeterCategory()
The statistics meter category.


addAddress

public void addAddress(java.lang.String address)

addClient

public void addClient(ClientSocketFactory client)
Adds a client pool factory.


getClientList

public java.util.ArrayList<ClientSocketFactory> getClientList()

setTargetCluster

public void setTargetCluster(java.lang.String clusterId)
Sets the target cluster by id.


setTargetPort

public void setTargetPort(int port)
Sets the target cluster by id.


setTargetCluster

public void setTargetCluster(CloudPod pod)
Sets the target cluster by CloudPod id.


create

public LoadBalanceManager create()
Returns the load balance manager.


createClientSocketFactory

protected ClientSocketFactory createClientSocketFactory(java.lang.String address)