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

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

public class JDKAsyncHttpProvider
extends Object
implements AsyncHttpProvider


Constructor Summary
JDKAsyncHttpProvider(AsyncHttpClientConfig config)
           
 
Method Summary
 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, 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> 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

execute

public <T> ListenableFuture<T> execute(Request request,
                                       AsyncHandler<T> handler,
                                       ListenableFuture<?> future)
                            throws IOException
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,
                                Collection<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


Copyright © 2011. All Rights Reserved.