Package org.eclipse.jetty.proxy
Class AsyncMiddleManServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.eclipse.jetty.proxy.AbstractProxyServlet
-
- org.eclipse.jetty.proxy.AsyncMiddleManServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AsyncMiddleManServlet.Transparent
public class AsyncMiddleManServlet extends AbstractProxyServlet
Servlet 3.1 asynchronous proxy servlet with capability to intercept and modify request/response content.
Both the request processing and the I/O are asynchronous.
- See Also:
ProxyServlet
,AsyncProxyServlet
,ConnectHandler
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AsyncMiddleManServlet.ContentTransformer
Allows applications to transform upstream and downstream content.static class
AsyncMiddleManServlet.GZIPContentTransformer
protected class
AsyncMiddleManServlet.ProxyReader
protected class
AsyncMiddleManServlet.ProxyResponseListener
protected class
AsyncMiddleManServlet.ProxyWriter
static class
AsyncMiddleManServlet.Transparent
Convenience extension ofAsyncMiddleManServlet
that offers transparent proxy functionalities.-
Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
AbstractProxyServlet.TransparentDelegate
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
_log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERS
-
-
Constructor Summary
Constructors Constructor Description AsyncMiddleManServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AsyncMiddleManServlet.ContentTransformer
newClientRequestContentTransformer(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest)
protected DeferredContentProvider
newProxyContentProvider(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest)
protected javax.servlet.ReadListener
newProxyReadListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest, DeferredContentProvider provider)
protected Response.CompleteListener
newProxyResponseListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse)
protected AsyncMiddleManServlet.ProxyWriter
newProxyWriteListener(javax.servlet.http.HttpServletRequest clientRequest, Response proxyResponse)
protected AsyncMiddleManServlet.ContentTransformer
newServerResponseContentTransformer(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Response serverResponse)
protected void
onContinue(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest)
protected void
service(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse)
-
Methods inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
addProxyHeaders, addViaHeader, addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, filterServerResponseHeader, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, init, newHttpClient, newProxyRequest, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, rewriteTarget, sendProxyRequest, sendProxyResponseError, setTimeout, validateDestination
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
service
protected void service(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse) throws javax.servlet.ServletException, java.io.IOException
- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
-
newProxyContentProvider
protected DeferredContentProvider newProxyContentProvider(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest) throws java.io.IOException
- Throws:
java.io.IOException
-
newProxyReadListener
protected javax.servlet.ReadListener newProxyReadListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest, DeferredContentProvider provider)
-
newProxyWriteListener
protected AsyncMiddleManServlet.ProxyWriter newProxyWriteListener(javax.servlet.http.HttpServletRequest clientRequest, Response proxyResponse)
-
newProxyResponseListener
protected Response.CompleteListener newProxyResponseListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse)
- Specified by:
newProxyResponseListener
in classAbstractProxyServlet
-
newClientRequestContentTransformer
protected AsyncMiddleManServlet.ContentTransformer newClientRequestContentTransformer(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest)
-
newServerResponseContentTransformer
protected AsyncMiddleManServlet.ContentTransformer newServerResponseContentTransformer(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Response serverResponse)
-
onContinue
protected void onContinue(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest)
- Overrides:
onContinue
in classAbstractProxyServlet
-
-