com.caucho.rewrite
Class HttpProxy
java.lang.Object
com.caucho.rewrite.AbstractDispatchRule
com.caucho.rewrite.AbstractRegexpDispatchRule
com.caucho.rewrite.AbstractTargetDispatchRule
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>
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 |
HttpProxy
public HttpProxy()
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