zoukankan      html  css  js  c++  java
  • SPRING IN ACTION 第4版笔记-第四章ASPECT-ORIENTED SPRING-004-使用AspectJ’s pointcut expression language定义Pointcut

    一、

    1.在Spring中,pointcut是通过AspectJ’s pointcut expression language来定义的,但spring只支持它的一部分,如果超出范围就会报IllegalArgumentException,支持的语法如下:

    其实就是支持execution(),然后通过其他的标签来缩小范围

    2.例子

    package concert;
    public interface Performance {
        public void perform();
    }

    (1)不限返回类型,不限函数参数原型,只要是concert.Performance执行perform(),就织入

    (2)使用within限定范围包的范围

    PS:对应还有||(或)、!(非),但在xml中时要用and 、or 、not

    (3)在bean()中指定bean id 或name来限定bean的范围

    只有id为"woodstock"的bean才会被织入

    execution(* concert.Performance.perform())
    and bean('woodstock')

    与上面相反

    execution(* concert.Performance.perform())
    and !bean('woodstock')
  • 相关阅读:
    【案例】ora600
    Oracle 10046 event
    Oracle redo与undo浅析
    BUFFER CACHE和SHARED POOL原理
    oracle体系结构基础
    Oracle-buffer cache、shared pool
    获取oracle数据库对象定义
    ORA-20011
    expdp/impdp中NETWORK_LINK参数使用
    day03-Python基础
  • 原文地址:https://www.cnblogs.com/shamgod/p/5238896.html
Copyright © 2011-2022 走看看