com.caucho.rewrite
Class HttpProxy

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.HttpProxy
All Implemented Interfaces:
DispatchRule

@Configurable
public class HttpProxy
extends AbstractTargetDispatchRule

Dispatches a request to a backend server using HTTP as the proxy protocol.

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

   <resin:HttpProxy regexp="^/remote">
     <address>127.0.0.1:8080</address>
   </resin:HttpProxy>

 </web-app>
 


Nested Class Summary
static class HttpProxy.ProxyFilterChain
           
static class HttpProxy.ProxyRequest
           
 
Constructor Summary
HttpProxy()
           
 
Method Summary
 void addAddress(java.lang.String address)
          Adds a backend HTTP server address like "127.0.0.1:8081"
 FilterChain createDispatch(DispatcherType type, java.lang.String uri, java.lang.String queryString, java.lang.String target, FilterChain next)
           
 void init()
           
 void setFailRecoverTime(Period period)
          Sets the timeout to recover from a failed connection to the backend.
 
Methods inherited from class com.caucho.rewrite.AbstractTargetDispatchRule
getTarget, rewriteDefault, 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

HttpProxy

public HttpProxy()
Method Detail

addAddress

@Configurable
public void addAddress(java.lang.String address)
Adds a backend HTTP server address like "127.0.0.1:8081"

Parameters:
address - the backend address likst "127.0.0.1:8081"

setFailRecoverTime

@Configurable
public void setFailRecoverTime(Period period)
Sets the timeout to recover from a failed connection to the backend.

Parameters:
period - the recover timeout

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