首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

AOP 学习, 前置通报和后置通知

2012-10-29 
AOP 学习, 前置通知和后置通知1. 前置通知a. 可以修改传给目标方法的参数b. 可以抛出异常,阻止方法的执行c

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());  

热点排行