public interface

AsyncHttpProvider

com.ning.http.client.AsyncHttpProvider
Known Indirect Subclasses

Class Overview

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

Summary

Public Methods
abstract void close()
Close the current underlying TCP/HTTP connection.
abstract <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler)
Execute the request and invoke the AsyncHandler when the response arrive.
abstract Response prepareResponse(HttpResponseStatus status, HttpResponseHeaders headers, Collection<HttpResponseBodyPart> bodyParts)
Prepare a Response

Public Methods

public abstract void close ()

Close the current underlying TCP/HTTP connection.

public abstract ListenableFuture<T> execute (Request request, AsyncHandler<T> handler)

Execute the request and invoke the AsyncHandler when the response arrive.

Parameters
handler an instance of AsyncHandler
Returns
Throws
IOException

public abstract Response prepareResponse (HttpResponseStatus status, HttpResponseHeaders headers, Collection<HttpResponseBodyPart> bodyParts)

Prepare a Response

Parameters
status HttpResponseStatus
headers HttpResponseHeaders
bodyParts list of HttpResponseBodyPart
Returns