Spring AOP与AspectJ集成及应用实践
1. Spring AOP中的Advisors
在Spring AOP的经典部分,Advisors用于将切面(Aspect)和通知(Advice)结合在一起,它是Spring特有的构造,而非AspectJ的。使用注解时,Advisors并不存在;而使用XML模式时,可以使用 <aop:advisor> 标签。最常见的使用场景是与事务通知 <tx:advice> 结合。
以下是一个XML配置示例:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schem
超级会员免费看
订阅专栏 解锁全文
1071

被折叠的 条评论
为什么被折叠?



