com.ning.http.client
Interface AsyncHttpProvider<A>

All Known Implementing Classes:
JDKAsyncHttpProvider, NettyAsyncHttpProvider

public interface AsyncHttpProvider<A>

Interface to be used when implementing custom asynchronous I/O HTTP client. By default, the NettyAsyncHttpProvider is used.


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
 

Method Detail

execute

<T> Future<T> execute(Request request,
                      AsyncHandler<T> handler)
                  throws IOException
Execute the request and invoke the AsyncHandler when the response arrive.

Parameters:
handler - an instance of AsyncHandler
Returns:
a Future of Type T.
Throws:
IOException

close

void close()
Close the current underlying TCP/HTTP connection.s


prepareResponse

Response prepareResponse(HttpResponseStatus status,
                         HttpResponseHeaders headers,
                         Collection<HttpResponseBodyPart> bodyParts)
Prepare a Response

Parameters:
status - HttpResponseStatus
headers - HttpResponseHeaders
bodyParts - list of HttpResponseBodyPart
Returns:
a Response


Copyright © 2010. All Rights Reserved.