com.ning.http.client.providers.jdk
Class JDKAsyncHttpProvider

java.lang.Object
  extended by com.ning.http.client.providers.jdk.JDKAsyncHttpProvider
All Implemented Interfaces:
AsyncHttpProvider<HttpURLConnection>

public class JDKAsyncHttpProvider
extends Object
implements AsyncHttpProvider<HttpURLConnection>


Constructor Summary
JDKAsyncHttpProvider(AsyncHttpClientConfig config)
           
 
Method Summary
 void close()
          Close the current underlying TCP/HTTP connection.s
<T> Future<T>
execute(Request request, AsyncHandler<T> handler)
          Execute the request and invoke the AsyncHandler when the response arrive.
 Response prepareResponse(HttpResponseStatus status, HttpResponseHeaders headers, Collection<HttpResponseBodyPart> bodyParts)
          Prepare a Response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKAsyncHttpProvider

public JDKAsyncHttpProvider(AsyncHttpClientConfig config)
Method Detail

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.