if (onInvokeMethod == null && onInvokeInst == null) { // @3
return;
}
if (onInvokeMethod == null || onInvokeInst == null) { // @4
throw new IllegalStateException(“service:” + invoker.getUrl().getServiceKey() + " has a onreturn callback config , but no such " + (onInvokeMethod == null ? “method” :
“instance”) + " found. url:" + invoker.getUrl());
}
if (!onInvokeMethod.isAccessible()) {
onInvokeMethod.setAccessible(true);
}
Object[] params = invocation.getArguments();
try {
onInvokeMethod.invoke(onInvokeInst, params); // @5
} catch (InvocationTargetException e) {
fireThrowCallback(invoker, invocation, e.getTargetException()); // @6
} catch (Throwable e) {
fireThrowCallback(invoker, invocation, e); // @7
}