aop after-returning 和after的区别?
aop after-returning 和after的区别? 难道只是执行顺序的先后问题呢?大家都是在方法执行后返回,区别在哪里呢
aop after-returning 和after的区别? 难道只是执行顺序的先后问题呢?大家都是在方法执行后返回,区别在哪里呢
2015-04-25
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Object result;
try {
//@Before
result = method.invoke(target, args);
//@AfterReturning
return result;
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
//@AfterThrowing
throw targetException;
} finally {
//@After
}
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Object result;
try {
//@Before
result = method.invoke(target, args);
//@After
return result;
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
//@AfterThrowing
throw targetException;
} finally {
//@AfterReturning
}
}
举报