zoukankan      html  css  js  c++  java
  • struts2+spring+hibernate

    参考

    1.http://blog.csdn.net/liujiahan629629/article/details/21562597

    2.http://blog.csdn.net/tkd03072010/article/details/7468769

    spring AOP中的相关概念:

    在Spring官网关于AOP的视频教程中,是这样定义的:

         ·Join point

                 -A point in the execution of a program such as a method call or field assigment

         ·Pointcut

                -An expresion that selects one or more in Join point

         ·Adivce

                -Code to be executed at a Join Point that has been selected by a Pointcut

         ·Aspect

               -A module that encapsulates pointcut and Adivce

    我的理解大概是这个意思:

          Join point:一个要被拦截的方法(在spring里面我们主要做的就是拦截方法,所以对于属性的AOP就先不理会了)

          Pointcut:在execution表达式里面声明的一个或多个方法被拦截方法的集合

    advice    :应用在被拦截方法中的代码或者说函数,如,切面类中被@before(....)等注释了的成员函数

         

          advisor:负责声明“建议”在什么时候被执行,比如说,在被拦截方法执行前@before(...) ,@afterReturnning(...)等

          Aspect   :一个封装了切入面和切入点的模块

    下面是一个例子:

          @Aspect

         public class PropertyChangerTracker{

                 @before("execution(* com.demo.Target.set*(..))")

                 public void changeTracker(){

                         System.out.println("The Target Object's Property changes.......");

                  }

        }

        Join Point :如,void com.demo.Target.setName();

        Pointcut:  * com.demo.Target.set*(..)

     advice:public void changeTracker(){........}

        advisor: @before("execution(* com.demo.Target.set*(..))")

  • 相关阅读:
    查看oracle死锁进程并结束死锁
    用windows 定时任务执行kettle的ktr文件,以及问题处理
    Sentinel 高可用流量管理框架
    python
    Excel Vlookup用法和常见报错#REF! #Value!
    OutLook从excel导入联系人
    配置windows server多个用户同时使用一个账户远程服务器
    从Sql Server转战Oracle 之 变量声明
    数据库tempdb的事物日志已满,原因为“ACTIVE_TRANSACTION”
    Chapter 2
  • 原文地址:https://www.cnblogs.com/chuiyuan/p/5805782.html
Copyright © 2011-2022 走看看