Class HttpSender
- All Implemented Interfaces:
EventListener,AsyncContentProvider.Listener
- Direct Known Subclasses:
HttpSenderOverHTTP
HttpSender abstracts the algorithm to send HTTP requests, so that subclasses only implement
the transport-specific code to send requests over the wire, implementing
sendHeaders(HttpExchange, HttpContent, Callback) and
sendContent(HttpExchange, HttpContent, Callback).
HttpSender governs two state machines.
The request state machine is updated by HttpSender as the various steps of sending a request
are executed, see RequestState.
At any point in time, a user thread may abort the request, which may (if the request has not been
completely sent yet) move the request state machine to RequestState#FAILURE.
The request state machine guarantees that the request steps are executed (by I/O threads) only if
the request has not been failed already.
The sender state machine is updated by HttpSender from three sources: deferred content notifications
(via onContent()), 100-continue notifications (via proceed(HttpExchange, Throwable))
and normal request send (via sendContent(HttpExchange, HttpContent, Callback)).
This state machine must guarantee that the request sending is never executed concurrently: only one of
those sources may trigger the call to sendContent(HttpExchange, HttpContent, Callback).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanabort(HttpExchange exchange, Throwable failure) Deprecated.booleanisFailed()Deprecated.voidDeprecated.Callback method invoked when content is availablevoidproceed(HttpExchange exchange, Throwable failure) Deprecated.voidsend(HttpExchange exchange) Deprecated.toString()Deprecated.
-
Method Details
-
isFailed
public boolean isFailed()Deprecated. -
onContent
public void onContent()Deprecated.Description copied from interface:AsyncContentProvider.ListenerCallback method invoked when content is available- Specified by:
onContentin interfaceAsyncContentProvider.Listener
-
send
Deprecated. -
proceed
Deprecated. -
abort
Deprecated. -
toString
Deprecated.
-