org.apache.wink.client
Class AsyncHttpClientConnectionHandler
java.lang.Object
org.apache.wink.client.internal.handlers.AbstractConnectionHandler
org.apache.wink.client.AsyncHttpClientConnectionHandler
- All Implemented Interfaces:
- Closeable, ClientHandler, ConnectionHandler
public class AsyncHttpClientConnectionHandler
- extends org.apache.wink.client.internal.handlers.AbstractConnectionHandler
- implements Closeable
Extends AbstractConnectionHandler
and uses AsyncHttpClient
to perform HTTP request execution.
Methods inherited from class org.apache.wink.client.internal.handlers.AbstractConnectionHandler |
adaptInputStream, adaptOutputStream, writeEntity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncHttpClientConnectionHandler
public AsyncHttpClientConnectionHandler(com.ning.http.client.AsyncHttpClient asyncHttpClient)
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Throws:
IOException
handle
public ClientResponse handle(ClientRequest request,
HandlerContext context)
throws Exception
- Description copied from interface:
ClientHandler
- This method is invoked for every request invocation to allow the handler
to perform custom actions during the invocation. This method may be
called more that once for a single request, so handlers are must be
prepared to handle such situations.
- Specified by:
handle
in interface ClientHandler
- Parameters:
request
- a modifiable ClientRequest
containing the request
detailscontext
- the handler context
- Returns:
- a
ClientResponse
instance containing the response details
- Throws:
Exception
- any exception can be thrown by a handler and it will be
caught by the underlying client implementation and wrapped in
a ClientRuntimeException
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.