我希望捕获具有最佳性能的AOP的所有异常日志

时间:2012-01-18 04:38:02

标签: performance spring aop

我认为春天AOP比aspectj慢30倍。

因此,我在spring上下文xml中插入下面的代码。

<aop:aspectj-autoproxy /> 

那么,aspectj是否应用于?

请告诉我以及任何可以替代性能更好的想法!!

1 个答案:

答案 0 :(得分:2)

 <aop:aspectj-autoproxy/> 

只需启用@AspectJ注释支持.AOP运行时仍然是纯Spring AOP。请参阅spring reference中的以下内容。

 @AspectJ refers to a style of declaring aspects as regular Java classes annotated with 
 Java 5 annotations. The @AspectJ style was introduced by the AspectJ project as part of 
 the AspectJ 5 release. Spring 2.0 interprets the same annotations as AspectJ 5, using a 
 library supplied by AspectJ for pointcut parsing and matching. The AOP runtime is still 
 pure Spring AOP though, and there is no dependency on the AspectJ compiler or weaver.

如果您想使用Aspectj编译器/ weaver,请检查here