Package org.eclipse.jetty.proxy
Class AsyncMiddleManServlet.ProxyResponseListener
java.lang.Object
org.eclipse.jetty.client.api.Response.Listener.Adapter
org.eclipse.jetty.proxy.AsyncMiddleManServlet.ProxyResponseListener
- All Implemented Interfaces:
EventListener,Response.AsyncContentListener,Response.BeginListener,Response.CompleteListener,Response.ContentListener,Response.DemandedContentListener,Response.FailureListener,Response.HeaderListener,Response.HeadersListener,Response.Listener,Response.ResponseListener,Response.SuccessListener,Callback,Invocable
- Enclosing class:
- AsyncMiddleManServlet
protected class AsyncMiddleManServlet.ProxyResponseListener
extends Response.Listener.Adapter
implements Callback
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Response.Listener
Response.Listener.Adapter -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProxyResponseListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse) -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback invoked when the operation fails.voidCallback 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 serverResponse, ByteBuffer content, Callback callback) 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.voidCallback method invoked when the whole response has been successfully received.voidCallback invoked when the operation completes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Callback
completeWithMethods inherited from interface org.eclipse.jetty.util.thread.Invocable
getInvocationTypeMethods inherited from interface org.eclipse.jetty.client.api.Response.AsyncContentListener
onContentMethods inherited from interface org.eclipse.jetty.client.api.Response.DemandedContentListener
onBeforeContentMethods inherited from interface org.eclipse.jetty.client.api.Response.Listener
onContent, onFailure, onHeader
-
Constructor Details
-
ProxyResponseListener
protected ProxyResponseListener(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse)
-
-
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:
serverResponse- 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:
serverResponse- 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. Thecallbackobject should be succeeded to signal that thecontentbuffer has been consumed and to demand more content.- Specified by:
onContentin interfaceResponse.AsyncContentListener- Specified by:
onContentin interfaceResponse.ContentListener- Parameters:
serverResponse- the response containing the response line data and the headerscontent- the content bytes receivedcallback- the callback to call when the content is consumed and to demand more content
-
onSuccess
Description copied from interface:Response.SuccessListenerCallback method invoked when the whole response has been successfully received.- Specified by:
onSuccessin interfaceResponse.Listener- Specified by:
onSuccessin interfaceResponse.SuccessListener- Parameters:
serverResponse- the response containing the response line data and the headers
-
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
-
succeeded
public void succeeded()Description copied from interface:CallbackCallback invoked when the operation completes.
-
failed
Description copied from interface:CallbackCallback invoked when the operation fails.
-