- Direct Known Subclasses:
@Deprecated(since="2021-05-27") public abstract class HttpReceiver extends ObjectDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
HttpReceiverprovides the abstract code to implement the various steps of the receive of HTTP responses.
HttpReceivermaintains 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 available
responseHeader(HttpExchange, HttpField), when an HTTP field is available
responseHeaders(HttpExchange), when all HTTP headers are available
responseContent(HttpExchange, ByteBuffer, Callback), when HTTP content is available
responseSuccess(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:
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description
abort(HttpExchange exchange, Throwable failure)Deprecated.