try {
SerializableInvocation proxyInvocation = (SerializableInvocation) invocation;
Method m = proxyInvocation.getMethod();
Object args[] = proxyInvocation.getArgs();
Object rc = m.invoke(target, args);
return new SimpleInvocationResult(true, rc);
} catch (InvocationTargetException e) {
Throwable t = e.getCause();
if (t instanceof Exception && t instanceof RuntimeException == false) {
return new SimpleInvocationResult(false, (Exception)t);
} else {
throw t;
}
}
}