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 劉錚 閱讀(245) 評論(0)  編輯  收藏 所屬分類: Spring

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 南皮县| 正宁县| 双牌县| 新沂市| 德安县| 文成县| 富川| 商城县| 镇原县| 高雄市| 阳高县| 长汀县| 纳雍县| 永仁县| 剑河县| 惠来县| 建瓯市| 上饶市| 盐城市| 孝义市| 明水县| 女性| 云南省| 通渭县| 沙洋县| 宁夏| 安乡县| 琼结县| 富平县| 仁寿县| 亚东县| 沁源县| 舞钢市| 哈巴河县| 永仁县| 彭水| 原平市| 莱阳市| 兴安县| 澄江县| 田阳县|