com.ning.http.client
Class AsyncCompletionHandlerBase

java.lang.Object
  extended by com.ning.http.client.AsyncCompletionHandler<Response>
      extended by 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: &#64;Override public Response onCompleted(Response response) throws Exception &#123; asyncHttpClient.getConfig().executorService().execute(new Runnable() &#123; public void run() &#123; asyncHttpClient.prepareGet(...); &#125; &#125;); return response; &#125;


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler
AsyncHandler.STATE
 
Constructor Summary
AsyncCompletionHandlerBase()
           
 
Method Summary
 Response onCompleted(Response response)
          Invoked once the HTTP response has been fully read.
 void onThrowable(Throwable t)
          Invoked when an unexpected exception occurs during the processing of the response
 
Methods inherited from class com.ning.http.client.AsyncCompletionHandler
onBodyPartReceived, onCompleted, onContentWriteCompleted, onContentWriteProgress, onHeadersReceived, onHeaderWriteCompleted, onStatusReceived
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncCompletionHandlerBase

public AsyncCompletionHandlerBase()
Method Detail

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.