<分区>
我正在阅读 spring documentation关于 AOP,现在我在关于使用 @AspectJ
样式的部分。
Spring AOP is implemented in pure Java. There is no need for a special compilation process. Spring AOP does not need to control the class loader hierarchy, and is thus suitable for use in a Servlet container or application server.
但是在关于@AspectJ
风格的部分说
The
@AspectJ
support can be enabled with XML or Java style configuration. In either case you will also need to ensure that AspectJ’saspectjweaver.jar
library is on the classpath of your application (version 1.6.8 or later).
据我所知,aspectjweaver.jar
在编译时或加载时执行切面的实际编织。但是 Spring 有自己的基于代理的实现。所以我真的看不出任何依赖 aspectjweaver.jar
的原因。
没错,要使用@Aspect
注解我们需要aspectjrt
依赖。但是我不清楚对编织者的依赖。您不能简要解释一下它的实际工作原理吗?