Class RetainingResponseListener
- 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
- Direct Known Subclasses:
CompletableResponseListener
,ContinueProtocolHandler.ContinueListener
Implementation of Response.Listener
that retains the response
content without copying it, up to a configurable number of bytes.
The content may be retrieved from AbstractResponseListener.onSuccess(Response)
or Response.Listener.onComplete(Result)
via AbstractResponseListener.getContent()
or AbstractResponseListener.getContentAsString()
.
Instances of this class are not reusable, so one must be allocated for each request.
The implementation retains the response content chunks, and converts them into a byte[]
upon response success, returned by AbstractResponseListener.getContent()
.
Subclasses overriding AbstractResponseListener.onSuccess(Response)
or AbstractResponseListener.onFailure(Response, Throwable)
must always call the super
method to guarantee that the retained chunks are released.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.eclipse.jetty.client.AbstractResponseListener
getContent, getContentAsInputStream, getContentAsString, getContentAsString, getContentAsString, getEncoding, getMaxLength, getMediaType, onContent, onFailure, onHeaders, onSuccess
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.client.Response.AsyncContentListener
onContentSource
Methods inherited from interface org.eclipse.jetty.client.Response.Listener
onBegin, onComplete, onContent, onHeader
-
Constructor Details
-
RetainingResponseListener
public RetainingResponseListener() -
RetainingResponseListener
public RetainingResponseListener(int maxLength)
-