8
头图

25 articles have been serialized in the "Line Interviewer" series! deep and fun series!

The key source code method (strongly recommend that you do it again)

  • org.springframework.context.support.AbstractApplicationContext#refresh (entrance)
  • org.springframework.context.support.AbstractApplicationContext#finishBeanFactoryInitialization (initialize singleton object entry)
  • org.springframework.beans.factory.config.ConfigurableListableBeanFactory#preInstantiateSingletons (initialize singleton object entry)
  • org.springframework.beans.factory.support.AbstractBeanFactory#getBean(java.lang.String) (The source of all evil, the entrance to obtain and create Bean)
  • org.springframework.beans.factory.support.AbstractBeanFactory#doGetBean actual acquisition and creation of Bean)
  • org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#getSingleton(java.lang.String) (try to get it from the cache)
  • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[]) (Instantiate Bean)
  • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#doCreateBean (Instantiated Bean concrete realization)
  • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#createBeanInstance (specific instantiation process)
  • org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#addSingletonFactory (Add the instantiated Bean to the third-level cache)
  • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#populateBean (attribute injection after instantiation)
  • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#initializeBean(java.lang.String, java.lang.Object, org.springframework.beans.factory.support.RootBeanDefinition) (initialization entry)

When I went to read the blog on the Internet, I found a few better pictures. Post them here for everyone to understand~

来源:https://www.jianshu.com/p/6c359768b1dc

Welcome to follow my WeChat public [160e28ad26941e Java3y ] to talk about Java interview

[Online Interviewer] Series two articles a week are being updated continuously!


Java3y
12.9k 声望9.2k 粉丝