com.ning.http.client.providers.grizzly
Class GrizzlyAsyncHttpProvider
java.lang.Object
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider
- All Implemented Interfaces:
- AsyncHttpProvider
public class GrizzlyAsyncHttpProvider
- extends Object
- implements AsyncHttpProvider
A Grizzly 2.0-based implementation of AsyncHttpProvider
.
- Since:
- 1.7.0
- Author:
- The Grizzly Team
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REMOTELY_CLOSED_EXCEPTION
public static final IOException REMOTELY_CLOSED_EXCEPTION
GrizzlyAsyncHttpProvider
public GrizzlyAsyncHttpProvider(AsyncHttpClientConfig clientConfig)
execute
public <T> ListenableFuture<T> execute(Request request,
AsyncHandler<T> handler)
throws IOException
- 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
close
public void close()
- Close the current underlying TCP/HTTP connection.
- Specified by:
close
in interface AsyncHttpProvider
prepareResponse
public Response prepareResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts)
- Prepare a
Response
- Specified by:
prepareResponse
in interface AsyncHttpProvider
- Parameters:
status
- HttpResponseStatus
headers
- HttpResponseHeaders
bodyParts
- list of HttpResponseBodyPart
- Returns:
- a
Response
execute
protected <T> ListenableFuture<T> execute(org.glassfish.grizzly.Connection c,
Request request,
AsyncHandler<T> handler,
GrizzlyResponseFuture<T> future,
boolean forceTxContextExist)
throws IOException
- Throws:
IOException
initializeTransport
protected void initializeTransport(AsyncHttpClientConfig clientConfig)
main
public static void main(String[] args)
Copyright © 2014. All Rights Reserved.