com.ning.http.client.providers.jdk
public class JDKAsyncHttpProvider extends java.lang.Object implements AsyncHttpProvider
Constructor and Description |
---|
JDKAsyncHttpProvider(AsyncHttpClientConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the current underlying TCP/HTTP connection.
|
<T> ListenableFuture<T> |
execute(Request request,
AsyncHandler<T> handler)
Execute the request and invoke the
AsyncHandler when the response arrive. |
<T> ListenableFuture<T> |
execute(Request request,
AsyncHandler<T> handler,
ListenableFuture<?> future) |
Response |
prepareResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
java.util.Collection<HttpResponseBodyPart> bodyParts)
Prepare a
Response |
public JDKAsyncHttpProvider(AsyncHttpClientConfig config)
public <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler) throws java.io.IOException
AsyncHttpProvider
AsyncHandler
when the response arrive.execute
in interface AsyncHttpProvider
handler
- an instance of AsyncHandler
ListenableFuture
of Type T.java.io.IOException
public <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler, ListenableFuture<?> future) throws java.io.IOException
java.io.IOException
public void close()
AsyncHttpProvider
close
in interface AsyncHttpProvider
public Response prepareResponse(HttpResponseStatus status, HttpResponseHeaders headers, java.util.Collection<HttpResponseBodyPart> bodyParts)
AsyncHttpProvider
Response
prepareResponse
in interface AsyncHttpProvider
status
- HttpResponseStatus
headers
- HttpResponseHeaders
bodyParts
- list of HttpResponseBodyPart
Response
Copyright © 2014. All Rights Reserved.