AOP 学习, 前置通知和后置通知
1. 前置通知
a. 可以修改传给目标方法的参数
b. 可以抛出异常,阻止方法的执行
c. 安全性检查
public class MyAfterAdvice implements MethodBeforeAdvice{ public void afterReturning(Object returnValue,Method method,Object[] args){ } } ProxyFactory pf=new ProxyFactory(); pf.setTarget(..); pf.addAdvice(new MyAfterAdvice());