public class GrizzlyAsyncHttpProvider extends Object implements AsyncHttpProvider
AsyncHttpProvider
.Modifier and Type | Class and Description |
---|---|
static class |
GrizzlyAsyncHttpProvider.BodyHandler |
static class |
GrizzlyAsyncHttpProvider.GracefulCloseEvent
FilterChainEvent to gracefully complete the request-response processing
when Connection is getting closed by the remote host. |
Modifier and Type | Field and Description |
---|---|
static IOException |
REMOTELY_CLOSED_EXCEPTION |
Constructor and Description |
---|
GrizzlyAsyncHttpProvider(AsyncHttpClientConfig clientConfig) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the current underlying TCP/HTTP connection.
|
protected <T> ListenableFuture<T> |
execute(org.glassfish.grizzly.Connection c,
Request request,
AsyncHandler<T> handler,
GrizzlyResponseFuture<T> future,
boolean forceTxContextExist) |
<T> ListenableFuture<T> |
execute(Request request,
AsyncHandler<T> handler)
Execute the request and invoke the
AsyncHandler when the response arrive. |
protected void |
initializeTransport(AsyncHttpClientConfig clientConfig) |
static void |
main(String[] args) |
Response |
prepareResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts)
Prepare a
Response |
public static final IOException REMOTELY_CLOSED_EXCEPTION
public GrizzlyAsyncHttpProvider(AsyncHttpClientConfig clientConfig)
public <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler) throws IOException
AsyncHandler
when the response arrive.execute
in interface AsyncHttpProvider
handler
- an instance of AsyncHandler
ListenableFuture
of Type T.IOException
public void close()
close
in interface AsyncHttpProvider
public Response prepareResponse(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
Response
prepareResponse
in interface AsyncHttpProvider
status
- HttpResponseStatus
headers
- HttpResponseHeaders
bodyParts
- list of HttpResponseBodyPart
Response
protected <T> ListenableFuture<T> execute(org.glassfish.grizzly.Connection c, Request request, AsyncHandler<T> handler, GrizzlyResponseFuture<T> future, boolean forceTxContextExist) throws IOException
IOException
protected void initializeTransport(AsyncHttpClientConfig clientConfig)
public static void main(String[] args)
Copyright © 2014. All Rights Reserved.