Package org.eclipse.jetty.client
Class HttpReceiver
java.lang.Object
org.eclipse.jetty.client.HttpReceiver
- Direct Known Subclasses:
HttpReceiverOverHTTP
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
HttpReceiver
provides the abstract code to implement the various steps of the receive of HTTP responses.
HttpReceiver
maintains a state machine that is updated when the steps of receiving a response are executed.
Subclasses must handle the transport-specific details, for example how to read from the raw socket and how to parse the bytes read from the socket. Then they have to call the methods defined in this class in the following order:
responseBegin(HttpExchange)
, when the HTTP response data containing the HTTP status code is availableresponseHeader(HttpExchange, HttpField)
, when an HTTP field is availableresponseHeaders(HttpExchange)
, when all HTTP headers are availableresponseContent(HttpExchange, ByteBuffer, Callback)
, when HTTP content is availableresponseSuccess(HttpExchange)
, when the response is successful
responseFailure(Throwable)
to indicate that the response has failed
(for example, because of I/O exceptions).
At any time, user threads may abort the response which will cause responseFailure(Throwable)
to be
invoked.
The state machine maintained by this class ensures that the response steps are not executed by an I/O thread if the response has already been failed.
- See Also:
-
Method Summary