Spring 中的特殊advice-intruduction advice

  1. intruduction advice这里没有MethodMatcher接口,因此也就没有 Pointcut接口与引入通知相关联。这里只进行类过滤。
  2. 与DefaultPointcutAdvisor不同,由于DefaultPointcutAdvisor有Pointcut,可以在class一级和method一级上进行控制。
  3. 一般使用DelegatingIntroductionInterceptor 作为拦截器,需要编写拦截的类必须继承DelegatingIntroductionInterceptor  ,在这个继承了DelegatingIntroductionInterceptor 的类中不再使用MethodInvocation的process()方法,使用super.invoke(methodinvocation),这样做的原因是父类DelegatingIntroductionInterceptor 能够决定什么class负责处理方法的调用
  4. advisor一般使用继承了DefaultIntroductionAdvisor 的类,创建的简单方法就是利用DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class clazz)这个构造函数。
  5. 在appplicationcontext-config.xml中就只需要加入<bean id="" class=""></bean>就可以了,不需要进行其它配置

 

posted on 2007-09-07 09:46 刘铮 阅读(228) 评论(0)  编辑  收藏 所属分类: Spring


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

留言簿(1)

文章分类(141)

文章档案(147)

搜索

最新评论