public class HttpTunnelingServlet
extends javax.servlet.http.HttpServlet
HttpServlet that proxies an incoming data to the actual server
and vice versa. Please refer to the
package summary for
the detailed usage.| Modifier and Type | Class and Description |
|---|---|
private static class |
HttpTunnelingServlet.OutboundConnectionHandler |
| Modifier and Type | Field and Description |
|---|---|
private ChannelFactory |
channelFactory |
private static java.lang.String |
CONNECT_ATTEMPTS |
private long |
connectAttempts |
private static java.lang.String |
ENDPOINT |
(package private) static InternalLogger |
logger |
private java.net.SocketAddress |
remoteAddress |
private static java.lang.String |
RETRY_DELAY |
private long |
retryDelay |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
HttpTunnelingServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected ChannelFactory |
createChannelFactory(java.net.SocketAddress remoteAddress) |
void |
destroy() |
protected void |
destroyChannelFactory(ChannelFactory factory) |
void |
init() |
protected java.net.SocketAddress |
parseEndpoint(java.lang.String endpoint) |
private static ChannelBuffer |
read(java.io.PushbackInputStream in) |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprivate static final long serialVersionUID
private static final java.lang.String ENDPOINT
private static final java.lang.String CONNECT_ATTEMPTS
private static final java.lang.String RETRY_DELAY
static final InternalLogger logger
private volatile java.net.SocketAddress remoteAddress
private volatile ChannelFactory channelFactory
private volatile long connectAttempts
private volatile long retryDelay
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected java.net.SocketAddress parseEndpoint(java.lang.String endpoint)
throws java.lang.Exception
java.lang.Exceptionprotected ChannelFactory createChannelFactory(java.net.SocketAddress remoteAddress) throws java.lang.Exception
java.lang.Exceptionpublic void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServletprotected void destroyChannelFactory(ChannelFactory factory) throws java.lang.Exception
java.lang.Exceptionprotected void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionjava.io.IOExceptionprivate static ChannelBuffer read(java.io.PushbackInputStream in) throws java.io.IOException
java.io.IOException