Spring 中的特殊advice-intruduction advice

          1. intruduction advice這里沒有MethodMatcher接口,因此也就沒有 Pointcut接口與引入通知相關(guān)聯(lián)。這里只進(jìn)行類過濾。
          2. 與DefaultPointcutAdvisor不同,由于DefaultPointcutAdvisor有Pointcut,可以在class一級(jí)和method一級(jí)上進(jìn)行控制。
          3. 一般使用DelegatingIntroductionInterceptor 作為攔截器,需要編寫攔截的類必須繼承DelegatingIntroductionInterceptor  ,在這個(gè)繼承了DelegatingIntroductionInterceptor 的類中不再使用MethodInvocation的process()方法,使用super.invoke(methodinvocation),這樣做的原因是父類DelegatingIntroductionInterceptor 能夠決定什么class負(fù)責(zé)處理方法的調(diào)用
          4. advisor一般使用繼承了DefaultIntroductionAdvisor 的類,創(chuàng)建的簡(jiǎn)單方法就是利用DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class clazz)這個(gè)構(gòu)造函數(shù)。
          5. 在appplicationcontext-config.xml中就只需要加入<bean id="" class=""></bean>就可以了,不需要進(jìn)行其它配置

           

          posted on 2007-09-07 09:46 劉錚 閱讀(242) 評(píng)論(0)  編輯  收藏 所屬分類: Spring

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導(dǎo)航

          統(tǒng)計(jì)

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評(píng)論

          主站蜘蛛池模板: 仙居县| 卫辉市| 龙州县| 修文县| 桃园县| 松桃| 肃宁县| 荆州市| 石渠县| 甘泉县| 牟定县| 资兴市| 桐城市| 大城县| 凯里市| 乌兰察布市| 社会| 应城市| 娱乐| 五大连池市| 彭水| 凤台县| 申扎县| 建平县| 荥经县| 油尖旺区| 于都县| 浦北县| 神农架林区| 清水河县| 永修县| 东山县| 临武县| 瑞昌市| 泰宁县| 大兴区| 镇远县| 开封县| 北安市| 崇礼县| 红桥区|