SpringIoc AOP解析
2021-04-15 16:36:18 0 举报
AOp调用链路
作者其他创作
大纲/内容
doGetBean
返回代理对象,注册Bean
getProxy
加载
createProxy
registerBeanDefinition
ProxyCreatorSupport
ProxyFactory
wrapIfNecessary
postProcessAfterInitialization
applyBeanPostProcessorsBeforeInstantiation
refresh()
new JdkDynamicAopProxy(config) || new ObjenesisCglibAopProxy(config)
注册了一个BeanId是internalAutoProxyCreatorvalue是AnnotationAwareAspectJAutoProxyCreator
xml Bean定义加载
postProcessBeforeInstantiation
代理生成阶段
AopConfigUtils
AspectJAutoProxyRegistrar
返回代理对象
前面的那个类实际上是个BeanPostProcess
AbstractBeanFactory
查找对代理类相关的advisor对象集合
AbstractAdvisorAutoProxyCreator
ClassPathXmlApplicationContext
AbstractRefreshableConfigApplicationContext
定位
AbstractAutowireCapableBeanFactory
createAopProxy()
完成其他SpringBean定义后finishBeanFactoryInitialization
AbstractApplicationContext
setConfigLocations()
AbstractAutoProxyCreator
收藏
0 条评论
回复 删除
下一页