public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { InvocationListener listener = getInvocationListener(); try { Object result = method.invoke(target, args); if (null != listener) { listener.afterInvoke(new InvocationEvent(target, method, args, result)); } return result; } catch (Throwable e) { if (null != listener) { listener.processException(new InvocationErrorEvent( target, method, args, e)); } throw e; } }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { InvocationListener listener = getInvocationListener(); try { Object result = method.invoke(target, args); if (null != listener) { listener.afterInvoke(new InvocationEvent(target, method, args, result)); } return result; } catch (Throwable e) { if (null != listener) { listener.processException(new InvocationErrorEvent( target, method, args, e)); } throw e; } }