Class HttpTunnelingServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.jboss.netty.channel.socket.http.HttpTunnelingServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class HttpTunnelingServlet extends javax.servlet.http.HttpServletAnHttpServletthat proxies an incoming data to the actual server and vice versa. Please refer to the package summary for the detailed usage.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classHttpTunnelingServlet.OutboundConnectionHandler
-
Field Summary
Fields Modifier and Type Field Description private ChannelFactorychannelFactoryprivate static java.lang.StringCONNECT_ATTEMPTSprivate longconnectAttemptsprivate static java.lang.StringENDPOINT(package private) static InternalLoggerloggerprivate java.net.SocketAddressremoteAddressprivate static java.lang.StringRETRY_DELAYprivate longretryDelayprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description HttpTunnelingServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ChannelFactorycreateChannelFactory(java.net.SocketAddress remoteAddress)voiddestroy()protected voiddestroyChannelFactory(ChannelFactory factory)voidinit()protected java.net.SocketAddressparseEndpoint(java.lang.String endpoint)private static ChannelBufferread(java.io.PushbackInputStream in)protected voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ENDPOINT
private static final java.lang.String ENDPOINT
- See Also:
- Constant Field Values
-
CONNECT_ATTEMPTS
private static final java.lang.String CONNECT_ATTEMPTS
- See Also:
- Constant Field Values
-
RETRY_DELAY
private static final java.lang.String RETRY_DELAY
- See Also:
- Constant Field Values
-
logger
static final InternalLogger logger
-
remoteAddress
private volatile java.net.SocketAddress remoteAddress
-
channelFactory
private volatile ChannelFactory channelFactory
-
connectAttempts
private volatile long connectAttempts
-
retryDelay
private volatile long retryDelay
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
parseEndpoint
protected java.net.SocketAddress parseEndpoint(java.lang.String endpoint) throws java.lang.Exception- Throws:
java.lang.Exception
-
createChannelFactory
protected ChannelFactory createChannelFactory(java.net.SocketAddress remoteAddress) throws java.lang.Exception
- Throws:
java.lang.Exception
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
destroyChannelFactory
protected void destroyChannelFactory(ChannelFactory factory) throws java.lang.Exception
- Throws:
java.lang.Exception
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
read
private static ChannelBuffer read(java.io.PushbackInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
-