|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonatype.spice.jersey.client.ahc.AhcClientHandler
public final class AhcClientHandler
A root handler with Sonatype AsyncHttpClient acting as a backend.
Client operations are thread safe, the HTTP connection may be shared between different threads. If a response entity is obtained that is an instance ofCloseable
then the instance MUST be closed after processing the entity to release
connection-based resources.
If a ClientResponse is obtained and an entity is not read from the
response then ClientResponse.close() MUST be called after processing
the response to release connection-based resources.
The following methods are currently supported: HEAD, GET, POST, PUT, DELETE, TRACE
OPTIONS as well as custom methods.
| Constructor Summary | |
|---|---|
AhcClientHandler(com.ning.http.client.AsyncHttpClient client)
Create a new root handler with an AsyncHttpClient. |
|
AhcClientHandler(com.ning.http.client.AsyncHttpClient client,
AhcConfig config)
Create a new root handler with an AsyncHttpClient. |
|
| Method Summary | |
|---|---|
AhcRequestWriter |
getAhcRequestWriter()
Return the instance of RequestWriter. |
AhcConfig |
getConfig()
Get the client config. |
com.ning.http.client.AsyncHttpClient |
getHttpClient()
Get the AsyncHttpClient. |
com.sun.jersey.api.client.ClientResponse |
handle(com.sun.jersey.api.client.ClientRequest cr)
Translate the ClientRequest into a AsyncHttpClient request, and execute it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AhcClientHandler(com.ning.http.client.AsyncHttpClient client)
AsyncHttpClient.
client - the AsyncHttpClient.
public AhcClientHandler(com.ning.http.client.AsyncHttpClient client,
AhcConfig config)
AsyncHttpClient.
client - the AsyncHttpClient.config - the client configuration.| Method Detail |
|---|
public AhcConfig getConfig()
public com.ning.http.client.AsyncHttpClient getHttpClient()
AsyncHttpClient.
AsyncHttpClient.
public com.sun.jersey.api.client.ClientResponse handle(com.sun.jersey.api.client.ClientRequest cr)
throws com.sun.jersey.api.client.ClientHandlerException
ClientRequest into a AsyncHttpClient request, and execute it.
handle in interface com.sun.jersey.api.client.ClientHandlercr - the HTTP request.
ClientResponse
com.sun.jersey.api.client.ClientHandlerExceptionpublic AhcRequestWriter getAhcRequestWriter()
RequestWriter. This instance will be injected
within Jersey so it cannot be null.
RequestWriter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||