[bean id="remoteRegisterCall" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"]
[property name="advice"]
[ref bean="remoteUserRegMethodAdvice" /]
[/property]
[property name="pattern"]
[value].*Remote*.*[/value]
[/property]
[/bean]
[!-- 在这里定义的userMemberService是随意的,这个名字一般用不到,其它的一般不引用这个id--]
[bean id="userMemberService" class="org.springframework.aop.framework.ProxyFactoryBean"]
[property name="target"]
[ref local="userMemberTarget" /][!--定义要拦截的对象--]
[/property]
[property name="interceptorNames"]
[list]
[value]remoteRegisterCall[/value]
[/list]
[/property]
[/bean]
[!--如上,这个courseInfoService,其它地方一般也用不到--]
[bean id="courseInfoService" class="org.springframework.aop.framework.ProxyFactoryBean"]
[property name="target"]
[ref local="courseInfoTarget" /][!--定义要拦截的对象--]
[/property]
[property name="interceptorNames"]
[list]
[value]remoteRegisterCall[/value]
[/list]
[/property]
[/bean]
[!--以下定义的拦截器的实现--]
[bean name="remoteUserRegMethodAdvice" class="mypro.leopard.framework.remoteservice.RemoteUserAdvice"]
[property name="remoteService"]
[ref bean="remoteService"/]
[/property]
[property name="netUpdateService"]
[ref bean="netUpdateService"/]
[/property]
[/bean]
我们直接查找拦截的对象,从上面我们可以看到它们里面凡是带remote的方法都被拦截下来,交给我们定义的拦截器RemoteUserAdvice处理
分享到:
相关推荐
Spring_AOP_学习小结 Spring_AOP_学习小结 Spring_AOP_学习小结 Spring_AOP_学习小结
Spring-Aop 一、Aop的概述 1.1、什么是Aop(摘自百度) 1.2、Aop的相关术语 二、基于XML的AOP配置 三、基于注解的AOP配置
Spring示例_Printer_Spring_AOP_Spring_Proxy
Spring_AOP笔记Spring_AOP笔记Spring_AOP笔记Spring_AOP笔记Spring_AOP笔记Spring_AOP笔记Spring_AOP笔记
SPRING_AOP_概念解析以及例子示范
spring_AOP实现方法大全spring_AOP实现方法大全
Spring_AOP入门与分析,深入分析技术精髓。
spring配置aop
Spring_AOP_before的使用
spring_aop麻雀 spring整合Hibernate,麻雀虽小五脏俱全
ESB应用Spring_AOP
Spring_AOP开发jar包
Spring源代码解析(五):Spring_AOP获取Proxy.doc
基于spring_aop_权限管理系统原型
Spring_Aop入门例子,可以直接导入,里面有Spring需要的jar包
spring_AOP的MethodBeforeAdvice详
Spring源代码解析(七):Spring_AOP中对拦截器调用的实现.doc