Object[] parameters = getIndividualRequestParameters( request);
String action = request.getAction();
String method = request.getMethod();
StandardSuccessResponseData response = new StandardSuccessResponseData( request.getTid(), action, method);
JsonDeserializationManager mgr = JsonDeserializationManager.getManager();
try {
Object result = dispatchStandardMethod(action, method, parameters);
mgr.friendOnlyAccess_setRoot(result);
response.setResult(result);
String json = getGson().toJson(response);
if( isBatched ) {
if( logger.isDebugEnabled() ) {
timer.stop();
timer.logDebugTimeInMilliseconds( " - Individual request #" + requestNumber + " response data=>" + json );
resultReported = true;
}
}
return json;
}
finally {
mgr.friendOnlyAccess_dispose(); // Cleanup in case we are reusing thread
}
}
catch( Exception t ) {
StandardErrorResponseData response = createJsonServerErrorResponse(request, t);
String json = getGson().toJson(response);