Spring AOP减慢了tomcat的启动时间

时间:2016-01-29 10:07:11

标签: spring tomcat spring-aop

我正在使用Spring(4.2.1)带有@AspectJ样式注释的AOP和<aop:aspectj-autoproxy/>

我正在使用AOP进行电子邮件发送,下载,审核,分析。它工作正常,但随着更多AOP的添加,应用程序的启动时间不断增加。

这是我用于Spring MVC项目的基本语法和配置。

在ApplicationContext.xml文件<aop:aspectj-autoproxy/>

@Component
@Aspect
public class AuditAddProduct {
    @Before("@annotation(AuditAddProductAccessAspect)")
    public void addProductAccessAspect(JoinPoint joinPoint) {
      }
}

如果我从我的applicationcontext文件中删除<aop:aspectj-autoproxy/>,那么服务器会在不到10秒的时间内启动,但是使用AOP时,它需要大约90秒到150秒。我绝对看起来纯粹是从一种方式来减轻启动和内存需求的负担,并且只想尝试迁移,如果它值得付出努力。

你能否分享我的任何提示将不胜感激。

0 个答案:

没有答案
相关问题