// invoke the appropriate method
HttpServletRequest request = HttpContextHelper.getRequest(inputParameters);
RestResponse restResponse = this.methodDelegator.delegate(request, controller);
// execute the rest response
RestResponseMetaData restResponseMetaData = restResponse.execute(outputStream, inputParameters);
// set the status-code with the result produced by the restResponse execution
ResponseHeaderCollector.setStatusCode(restResponseMetaData.getStatusCode());
// set the content type with the result produced by the restResponse execution
ResponseHeaderCollector.setMimeType(restResponseMetaData.getContentType());
} catch (Exception e) {
throw ExceptionHandler.getInvocationException(e);
}
}