com.ning.http.client.providers.apache
Class ApacheAsyncHttpProvider
java.lang.Object
com.ning.http.client.providers.apache.ApacheAsyncHttpProvider
- All Implemented Interfaces:
- AsyncHttpProvider
public class ApacheAsyncHttpProvider
- extends Object
- implements AsyncHttpProvider
An AsyncHttpProvider
for Apache Http Client 3.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApacheAsyncHttpProvider
public ApacheAsyncHttpProvider(AsyncHttpClientConfig config)
execute
public <T> ListenableFuture<T> execute(Request request,
AsyncHandler<T> handler)
throws IOException
- Description copied from interface:
AsyncHttpProvider
- Execute the request and invoke the
AsyncHandler
when the response arrive.
- Specified by:
execute
in interface AsyncHttpProvider
handler
- an instance of AsyncHandler
- Returns:
- a
ListenableFuture
of Type T.
- Throws:
IOException
close
public void close()
- Description copied from interface:
AsyncHttpProvider
- Close the current underlying TCP/HTTP connection.
- Specified by:
close
in interface AsyncHttpProvider
prepareResponse
public Response prepareResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts)
- Description copied from interface:
AsyncHttpProvider
- Prepare a
Response
- Specified by:
prepareResponse
in interface AsyncHttpProvider
- Parameters:
status
- HttpResponseStatus
headers
- HttpResponseHeaders
bodyParts
- list of HttpResponseBodyPart
- Returns:
- a
Response
requestTimeout
protected static int requestTimeout(AsyncHttpClientConfig config,
PerRequestConfig perRequestConfig)
Copyright © 2014. All Rights Reserved.