final CallTuple tuple = NamespaceUtil.get(destination,
request.getMethod());
final Object realDest = tuple.getDestination();
final String realMethod = tuple.getMethodName();
final AnnotatedMethod annotatedMethod = getMethod(realDest,
realMethod, requestParams, auth);
if (annotatedMethod == null) {
throw new JSONRPCException(
JSONRPCException.CODE.METHOD_NOT_FOUND,
"Method '"
+ request.getMethod()
+ "' not found. The method does not exist or you are not authorized.");
}
final Method method = annotatedMethod.getActualMethod();
final Object[] params = castParams(request.getParams(),
annotatedMethod.getParams(), requestParams);
Object result = method.invoke(realDest, params);
if (result == null) {
result = JOM.createNullNode();
}
resp.setResult(result);