Spring源码解析(十二)——AOP原理——@EnableAspectJAutoProxy

一、@EnableAspectJAutoProxy

第一步:注册AnnotationAwareAspectJAutoProxyCreator

把AnnotationAwareAspectJAutoProxyCreator创建为RootBeanDefinition,加入到BeanDefinitionRegistry中,key为org.springframework.aop.config.internalAutoProxyCreator

第二步:把注解信息拿到,针对proxyTargetClass和exposeProxy两个属性进行

小总结:

@EnableAspectJAutoProxy主要就是给容器注册AnnotationAwareAspectJAutoProxyCreator

@EnableXXX就是给容器注册XXX

https://my.oschina.net/kaywu123/blog/626135

猜你喜欢

转载自blog.csdn.net/csdn_kenneth/article/details/83479036