com.ning.http.client
Class AsyncCompletionHandlerBase
java.lang.Object
com.ning.http.client.AsyncCompletionHandler<Response>
com.ning.http.client.AsyncCompletionHandlerBase
- All Implemented Interfaces:
- AsyncHandler<Response>, ProgressAsyncHandler<Response>
public class AsyncCompletionHandlerBase
- extends AsyncCompletionHandler<Response>
Simple AsyncHandler of type Response
NOTE: Sending another asynchronous request from an AsyncHandler must be done using
another thread to avoid potential deadlock inside the AsyncHttpProvider
The recommended way is to use the ExecutorService from the AsyncHttpClientConfig:
@Override
public Response onCompleted(Response response) throws Exception
{
asyncHttpClient.getConfig().executorService().execute(new Runnable()
{
public void run()
{
asyncHttpClient.prepareGet(...);
}
});
return response;
}
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncCompletionHandlerBase
public AsyncCompletionHandlerBase()
onCompleted
public Response onCompleted(Response response)
throws Exception
- Description copied from class:
AsyncCompletionHandler
- Invoked once the HTTP response has been fully read.
- Specified by:
onCompleted in class AsyncCompletionHandler<Response>
- Parameters:
response - The Response
- Returns:
- Type of the value that will be returned by the associated
Future
- Throws:
Exception
onThrowable
public void onThrowable(Throwable t)
- Description copied from class:
AsyncCompletionHandler
- Invoked when an unexpected exception occurs during the processing of the response
- Specified by:
onThrowable in interface AsyncHandler<Response>- Overrides:
onThrowable in class AsyncCompletionHandler<Response>
- Parameters:
t - a Throwable
Copyright © 2010. All Rights Reserved.