private void invokeFiltersAndProcessResults(RequestExecutionReport executionReport,
final AugmentedRestLiResponseData responseData,
final Throwable appEx)
{
// Construct the filter response context from the partial response.
final FilterResponseContextInternal responseContext = new FilterResponseContextAdapter(responseData);
try
{
invokeResponseFilters(responseContext, appEx);
// Invoke onSuccess on the R2 callback since the response from the resource was
// successfully processed by the filters.
// Convert response data to partial rest response.
final PartialRestResponse response = _responseHandler.buildPartialResponse(_method, responseContext.getAugmentedRestLiResponseData());
// Invoke the callback.
_callback.onSuccess(_responseHandler.buildResponse(_method, response), executionReport);
}
catch (Throwable e)
{
// Invoke onError on the R2 callback since we received an exception from the filters.
_callback.onError(_responseHandler.buildRestException(e,
_responseHandler.buildPartialResponse(_method,
responseContext.getAugmentedRestLiResponseData())),
executionReport);
}
}