try {
return invocation.getMethod().invoke(this.burlapProxy, invocation.getArguments());
}
catch (InvocationTargetException ex) {
if (ex.getTargetException() instanceof BurlapRuntimeException) {
BurlapRuntimeException bre = (BurlapRuntimeException) ex.getTargetException();
Throwable rootCause = (bre.getRootCause() != null ? bre.getRootCause() : bre);
throw convertBurlapAccessException(rootCause);
}
else if (ex.getTargetException() instanceof UndeclaredThrowableException) {
UndeclaredThrowableException utex = (UndeclaredThrowableException) ex.getTargetException();
throw convertBurlapAccessException(utex.getUndeclaredThrowable());