org.alfresco.http
Class AbstractHttpRequestCallback<T>

java.lang.Object
  extended by org.alfresco.http.AbstractHttpRequestCallback<T>
All Implemented Interfaces:
HttpRequestCallback<T>
Direct Known Subclasses:
JSONArrayCallback, JSONObjectCallback, SimpleHttpRequestCallback

public abstract class AbstractHttpRequestCallback<T>
extends Object
implements HttpRequestCallback<T>

Response callback that returns the HttpResponse on success and throws runtime exceptions on errors.

Since:
1.2
Author:
Derek Hulley

Constructor Summary
AbstractHttpRequestCallback()
           
 
Method Summary
 T onCallException(org.apache.http.HttpResponse response, Throwable t)
          Called when an error occurs when sending the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.http.HttpRequestCallback
onCallSuccess
 

Constructor Detail

AbstractHttpRequestCallback

public AbstractHttpRequestCallback()
Method Detail

onCallException

public T onCallException(org.apache.http.HttpResponse response,
                         Throwable t)
Description copied from interface: HttpRequestCallback
Called when an error occurs when sending the request. Implementations can choose to propogate the error, generate a new one or process the and return a result.

Specified by:
onCallException in interface HttpRequestCallback<T>
t - optional exception that caused the error
Returns:
any result extracted from the response or error
Throws:
RuntimeException - error is wrapped and thrown


Copyright © 2012. All Rights Reserved.