EnableAspectJAutoProxy->AspectJAutoProxyRegistrar->AnnotationAwareAspectJAutoProxyCreator ConfigurationClass: beanName 'org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$AspectJAutoProxyingConfiguration$CglibAutoProxyConfiguration', class path resource [org/springframework/boot/autoconfigure/aop/AopAutoConfiguration$AspectJAutoProxyingConfiguration$CglibAutoProxyConfiguration.class]
->AspectJAutoProxyRegistrar
->AnnotationAwareAspectJAutoProxyCreator(beanPostProcessor) AspectJAutoProxyBeanDefinitionParser.parse
ObjenesisCglibAopProxy
JdkDynamicAopProxy
cglibAopProxy -> DynamicAdvisedInterceptor ->getInterceptorsAndDynamicInterceptionAdvice
public Object getProxy(@Nullable ClassLoader classLoader) { return createAopProxy().getProxy(classLoader); }
public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException {
if (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config)) {
Class<?> targetClass = config.getTargetClass();
if (targetClass == null) {
throw new AopConfigException("TargetSource cannot determine target class: " +
"Either an interface or a target is required for proxy creation.");
}
if (targetClass.isInterface() || Proxy.isProxyClass(targetClass)) {
return new JdkDynamicAopProxy(config);
}
return new ObjenesisCglibAopProxy(config);
}
else {
return new JdkDynamicAopProxy(config);
}
}
1.JdkDynamicAopProxy(config)
2.ObjenesisCglibAopProxy(config)
List<Object> chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass);