本文参考至:spring-framework-reference.pdf的7.3 章节

【Schema-based AOP support】

  If you are unable to use Java 5, or simply prefer an XML-based format, then Spring 2.0 also offers
support for defining aspects using the new "aop" namespace tags. The exact same pointcut expressions
and advice kinds are supported as when using the @AspectJ style, hence in this section we will focus on
the new syntax and refer the reader to the discussion in the previous section (Section 7.2, “@AspectJ
support”) for an understanding of writing pointcut expressions and the binding of advice parameters.

  To use the aop namespace tags described in this section, you need to import the spring-aop schema as
described in Appendix C, XML Schema-based configuration. See the section called “The aop schema” for
how to import the tags in the aop namespace.

  Within your Spring configurations, all aspect and advisor elements must be placed within an
<aop:config> element (you can have more than one <aop:config> element in an application
context configuration). An <aop:config> element can contain pointcut, advisor, and aspect elements
(note these must be declared in that order).

如果,你不能使用java5,或者更倾向于使用XML格式的配置文件,Spring2.0引入了支持使用配置文件配置Aop,使用【aop】的命名空间,相同的pointCut表

答式和各种advice(before、after、around、after returning)也可以像@AspectJ中一样的使用。因而在本节中,我们将主要介绍新的语义,并且涉及到

前面的章节,更好的理解如何编写pointCut表达式和绑定advice的参数。

  要使用在本节使用aop的命名空间标签,需要参考附录C引入spring-aop的schema即-XML Schema-based configuration。

在自己的Spring配置文件中,所有的aspect和advisor标签必须至于<aop:config>标签范围内【在一个配置文件中,可以有多个<aop:config>标签】,一个

【<aop:config>】标签可以包含point、advisor、和asect元素,特别强调:元素的命名,必须要按照上述的顺序

Schema-based AOP support的更多相关文章

  1. 开涛spring3(6.3) - AOP 之 6.3 基于Schema的AOP

    6.3  基于Schema的AOP 基于Schema的AOP从Spring2.0之后通过“aop”命名空间来定义切面.切入点及声明通知. 在Spring配置文件中,所以AOP相关定义必须放在<a ...

  2. 基于@AspectJ和schema的aop(一)

    在前面我们使用Pointcut和Advice描述切点和增强, 并使用Advisor整合两者描述切面.@AspectJ使用注解来描述切点和增强.两者使用的方式不同, 但是在本质上都是一样的. 我们还是用 ...

  3. 基于Schema的AOP 配置使用详解

    原文地址:http://jinnianshilongnian.iteye.com/blog/1418598 基于Schema的AOP从Spring2.0之后通过"aop"命名空间来 ...

  4. 第三章 AOP 基于Schema的AOP

    基于Schema定义的切面和前现两种方式定义的切面,内容上都差不多,只是表现形式不一样而已. 3.7.1一般增强的使用 a.目标类 public class Target { public void ...

  5. spring aop 基于schema的aop

    AOP的基本概念: 连接点(Jointpoint):表示需要在程序中插入横切关注点的扩展点,连接点可能是类初始化.方法执行.方法调用.字段调用或处理异常等等,Spring只支持方法执行连接点,在AOP ...

  6. Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework

    昨晚在 使用spring aop, 然后Tomcat启动的时候, 报了这么个错: Caused by: org.springframework.beans.factory.BeanCreationEx ...

  7. spring3: schema的aop与Aspectj的aop的区别

    schema的aop如下: 接口: package chapter6.service; public interface IHelloAroundService { public void sayAr ...

  8. spring3: 基于Schema的AOP

    6.3  基于Schema的AOP 基于Schema的AOP从Spring2.0之后通过“aop”命名空间来定义切面.切入点及声明通知. 在Spring配置文件中,所以AOP相关定义必须放在<a ...

  9. NoClassDefFoundError: Could not initialize class org.apache.cxf.jaxrs.provider.ProviderFactory org.springframework.aop.support.AopUtils.isCglibProxyClass

    报错: 2018-05-03 10:35:20 377 ERROR org.apache.juli.logging.DirectJDKLog.log:181 - Servlet.service() f ...

随机推荐

  1. 取得网站的IP 地址

    select utl_inaddr.get_host_address('smtp.163.com') ipaddress from dual;

  2. linux 链接控制

    如发现系统存在大量TIME_WAIT状态的连接,通过调整内核参数解决,vim /etc/sysctl.conf编辑文件,加入以下内容:net.ipv4.tcp_syncookies = 1net.ip ...

  3. shell ps1 提示设置

    PS1="\[\033[01;37m\]\u\[\033[00m\]@\[\033[01;31m\]localhost \t\[\033[00m\]:\[\033[01;35m\]\w\[\ ...

  4. 前端中的SEO

    前端中的SEO: mate.title META标签分两大部分:HTTP标题信息(HTTP-EQUIV)和页面描述信息(NAME). <Meta name="Keywords" ...

  5. 第二章——Serializable的使用(跨进程使用和Intent的传递对象)

    一.Serializable类(JAVA本身具有的) 简介:Serializable是一个接口. 作用:是JAVA提供的序列化接口,实现序列化和反序列化的操作. 二.跨进程使用 1.事前准备 publ ...

  6. Service(Local Service)简介

    一.Service的作用 主要用于在后台处理一些耗时的逻辑操作,或者去执行某些长期运行的操作. 二.Service的创建 1.主要方法 IBinder onBind(Intent intent):必须 ...

  7. 算法分析-动态规划(cut_rod)

    什么是动态规划,我们要如何描述它? 动态规划算法通常基于一个递推公式及一个或多个初始状态. 当前子问题的解将由上一次子问题的解推出.使用动态规划来解题只需要多项式时间复杂度, 因此它比回溯法.暴力法等 ...

  8. Oracle EBS-SQL (WIP-6):检查任务已完成但状态是发放的任务.sql

    select WE.WIP_ENTITY_NAME         ,MSI.SEGMENT1         ,MSI.DESCRIPTION         ,WDJ.CLASS_CODE     ...

  9. Oracle EBS-SQL (INV-2):检查帐户别名发放记录.sql

    SELECT FU.description                 操作者,         ITM.SEGMENT1               物料编码,         ITM.DESC ...

  10. PHP5中__call、__get、__set、__clone、__sleep、__wakeup的用法

    __construct(),__destruct(),__call(),__callStatic(),__get(),__set(),__isset(),__unset(),__sleep(),__w ...