public interface HttpAsyncExchange
HttpAsyncExchange
represents a server-side HTTP message exchange
where an HTTP response can be deferred without blocking the I/O event thread
and triggered asynchronously at a later point of later time.Modifier and Type | Method and Description |
---|---|
HttpRequest |
getRequest()
Returns the received HTTP request message.
|
HttpResponse |
getResponse()
Returns the default HTTP response message.
|
int |
getTimeout()
Returns timeout for this message exchange.
|
boolean |
isCompleted()
Determines whether or not the message exchange has been completed.
|
void |
setCallback(Cancellable cancellable)
Sets
Cancellable callback to be invoked in case the underlying
connection times out or gets terminated prematurely by the client. |
void |
setTimeout(int timeout)
Sets timeout for this message exchange.
|
void |
submitResponse()
Submits the default HTTP response and completed the message exchange.
|
void |
submitResponse(HttpAsyncResponseProducer responseProducer)
Submits an HTTP response using a custom
HttpAsyncResponseProducer . |
HttpRequest getRequest()
HttpResponse getResponse()
submitResponse()
method.void submitResponse()
HttpEntity
instance
the entity is also expected to implement the
HttpAsyncContentProducer
interface for efficient content streaming to a non-blocking HTTP
connection.IllegalStateException
- if a response has already been submitted.void submitResponse(HttpAsyncResponseProducer responseProducer)
HttpAsyncResponseProducer
.IllegalStateException
- if a response has already been submitted.boolean isCompleted()
true
if the message exchange has been completed,
false
otherwise.void setCallback(Cancellable cancellable)
Cancellable
callback to be invoked in case the underlying
connection times out or gets terminated prematurely by the client. This
callback can be used to cancel a long running response generating
process if a response is no longer needed.void setTimeout(int timeout)
int getTimeout()
Copyright © 2010 - 2020 Adobe. All Rights Reserved