4 spring AOP (spring 2.0 技术手册)

spring2.0 提供三种AOP实现方式:

1. spring1.2前版本, 实现AOP的接口,在xml配置。

2. spring2.0 <aop>标签,不用实现接口

3. @AspectJ的Annotation支持 JDK5.0

 

advices:

MethodBeforeAdvice (before advice)

AfterReturningAdvice (after advice)

MethodInterceptor    (around advice)     aopalliance 提供的接口

ThowsAdvice             (thorw advice)        标签接口

 

pointcut : 定义了感兴趣的jointPoint,每个pointcut都有相对应的PointcutAdvisor

 

NameMatchMethodPointcutAdvisor  *可以用来代替字符串

RegExpMethodPointcutAdvisor 正则表达式

ControlFlowPointcut   动态的Pointcut

 

pointcut接口

public interface Pointcut{
    Classfilter getClassFilter(); //决定类是否要运用advice
    MethodMather getMehodMatcher();  //某个方法是否要运用advice
    Pointcut TRUE = TruePointcut.INSTANCE;
}

Pointcut 交集、并集操作。

 

Introduction (特殊的advice)

对已有类添加一些额外的方法。(不改变已有类)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值