Class ProxyServlet.ProxyResponseListener
java.lang.Object
org.eclipse.jetty.ee10.proxy.ProxyServlet.ProxyResponseListener
- All Implemented Interfaces:
EventListener, Response.AsyncContentListener, Response.BeginListener, Response.CompleteListener, Response.ContentListener, Response.ContentSourceListener, Response.FailureListener, Response.HeaderListener, Response.HeadersListener, Response.Listener, Response.ResponseListener, Response.SuccessListener
- Enclosing class:
ProxyServlet
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProxyResponseListener(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.voidonComplete(Result result) Callback method invoked when the request and the response have been processed, either successfully or not.voidonContent(Response proxyResponse, Content.Chunk chunk, Runnable demander) Callback method invoked when the response content has been received, parsed and there is demand.voidCallback method invoked when all the response headers have been received and parsed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Response.AsyncContentListener
onContentSourceMethods inherited from interface Response.Listener
onContent, onFailure, onHeader, onSuccess
-
Constructor Details
-
ProxyResponseListener
protected ProxyResponseListener(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
-
-
Method Details
-
onBegin
Description copied from interface:Response.BeginListenerCallback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.This method is the best approximation to detect when the first bytes of the response arrived to the client.
- Specified by:
onBeginin interfaceResponse.BeginListener- Specified by:
onBeginin interfaceResponse.Listener- Parameters:
proxyResponse- the response containing the response line data
-
onHeaders
Description copied from interface:Response.HeadersListenerCallback method invoked when all the response headers have been received and parsed.- Specified by:
onHeadersin interfaceResponse.HeadersListener- Specified by:
onHeadersin interfaceResponse.Listener- Parameters:
proxyResponse- the response containing the response line data and the headers
-
onContent
Description copied from interface:Response.AsyncContentListenerCallback method invoked when the response content has been received, parsed and there is demand. Thechunkmust be consumed, copied, or retained before returning from this method as it is then automatically released. Thedemandermust be run before this method may be invoked again.- Specified by:
onContentin interfaceResponse.AsyncContentListener- Specified by:
onContentin interfaceResponse.ContentListener- Parameters:
proxyResponse- the response containing the response line data and the headerschunk- the chunk receiveddemander- the runnable to be run to demand the next chunk
-
onComplete
Description copied from interface:Response.CompleteListenerCallback method invoked when the request and the response have been processed, either successfully or not.The
resultparameter contains the request, the response, and eventual failures.Requests may complete after response, for example in case of big uploads that are discarded or read asynchronously by the server. This method is always invoked after
Response.SuccessListener.onSuccess(Response)orResponse.FailureListener.onFailure(Response, Throwable), and only when request indicates that it is completed.- Specified by:
onCompletein interfaceResponse.CompleteListener- Specified by:
onCompletein interfaceResponse.Listener- Parameters:
result- the result of the request / response exchange
-