com.ning.http.client.providers.jdk
Class JDKAsyncHttpProvider
java.lang.Object
com.ning.http.client.providers.jdk.JDKAsyncHttpProvider
- All Implemented Interfaces:
- AsyncHttpProvider<HttpURLConnection>
public class JDKAsyncHttpProvider
- extends Object
- implements AsyncHttpProvider<HttpURLConnection>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDKAsyncHttpProvider
public JDKAsyncHttpProvider(AsyncHttpClientConfig config)
execute
public <T> Future<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<HttpURLConnection>
handler
- an instance of AsyncHandler
- Returns:
- a
Future
of Type T.
- Throws:
IOException
close
public void close()
- Description copied from interface:
AsyncHttpProvider
- Close the current underlying TCP/HTTP connection.s
- Specified by:
close
in interface AsyncHttpProvider<HttpURLConnection>
prepareResponse
public Response prepareResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
Collection<HttpResponseBodyPart> bodyParts)
- Description copied from interface:
AsyncHttpProvider
- Prepare a
Response
- Specified by:
prepareResponse
in interface AsyncHttpProvider<HttpURLConnection>
- Parameters:
status
- HttpResponseStatus
headers
- HttpResponseHeaders
bodyParts
- list of HttpResponseBodyPart
- Returns:
- a
Response
Copyright © 2010. All Rights Reserved.