com.caucho.rewrite
Class LoadBalance

java.lang.Object
  extended by com.caucho.rewrite.AbstractDispatchRule
      extended by com.caucho.rewrite.AbstractRegexpDispatchRule
          extended by com.caucho.rewrite.AbstractTargetDispatchRule
              extended by com.caucho.rewrite.LoadBalance
All Implemented Interfaces:
DispatchRule

@Configurable
public class LoadBalance
extends AbstractTargetDispatchRule

Dispatches a request to the load balancer.

 <web-app xmlns:resin="urn:java:com.caucho.resin">

   <resin:LoadBalance regexp="^/remote" cluster="a"/>

 </web-app>
 


Nested Class Summary
static class LoadBalance.LoadBalanceFilterChain
           
static class LoadBalance.LoadBalanceRequest
           
 
Constructor Summary
LoadBalance()
           
 
Method Summary
 void add(StickyRequestHashGenerator gen)
           
 FilterChain createDispatch(DispatcherType type, java.lang.String uri, java.lang.String queryString, java.lang.String target, FilterChain next)
           
 void init()
           
protected  java.lang.String rewriteDefault(java.lang.String uri, java.lang.String queryString)
           
 void setCluster(java.lang.String cluster)
          Sets the target cluster for the load balancer
 void setStickySessions(boolean isSticky)
           
 void setStrategy(java.lang.String strategy)
          Sets the strategy for the load balancer
 
Methods inherited from class com.caucho.rewrite.AbstractTargetDispatchRule
getTarget, rewriteTarget, setAbsoluteTarget, setTarget, setTargetHost
 
Methods inherited from class com.caucho.rewrite.AbstractRegexpDispatchRule
add, add, add, getRegexp, isFilter, isForward, isInclude, isRequest, map, rewriteUri, setRegexp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoadBalance

public LoadBalance()
Method Detail

setCluster

@Configurable
public void setCluster(java.lang.String cluster)
Sets the target cluster for the load balancer


setStrategy

@Configurable
public void setStrategy(java.lang.String strategy)
Sets the strategy for the load balancer


setStickySessions

@Configurable
public void setStickySessions(boolean isSticky)

add

@Configurable
public void add(StickyRequestHashGenerator gen)

rewriteDefault

protected java.lang.String rewriteDefault(java.lang.String uri,
                                          java.lang.String queryString)
Overrides:
rewriteDefault in class AbstractTargetDispatchRule

init

@PostConstruct
public void init()
          throws ConfigException
Overrides:
init in class AbstractTargetDispatchRule
Throws:
ConfigException

createDispatch

public FilterChain createDispatch(DispatcherType type,
                                  java.lang.String uri,
                                  java.lang.String queryString,
                                  java.lang.String target,
                                  FilterChain next)
Overrides:
createDispatch in class AbstractRegexpDispatchRule