- The Bean Container finds the definition of the Spring Bean in the Configuration file.
---------------------在第2步之前还会检测是否实现了InstantiationAwareBeanPostProcessors,(源码注释:Give BeanPostProcessors a chance to return a proxy instead of the target bean instance),如果此postProcessBeforeInstantiation不返回null,后续doCreateBean方法中的aware方法,ini方法都不会执行----------
- The Bean Container creates an instance of the Bean using Java Reflection API.
- If any properties are mentioned, then they are also applied. If the property itself is a Bean, then it is resolved and set.
------------------------当执行第四步骤时候,bean在JVM中已经实例化,且完成了spring初始化的属性注入--------------
- BeanNameAwaresetBeanName()method will be called by passing the name of the Bean. (bean感知自己在factory中的名字)
- BeanClassLoaderAwaresetBeanClassLoader()ClassLoader
- BeanFactoryAwaresetBeanFactory()BeanFactory(bean感知自己所在在的factory)
- BeanPostProcessorsBeanFactorypostProcessBeforeInitialization()
- InitializingBeanafterPropertiesSet()
- 'init-method'
- postProcessAfterInitialization()
- DisposableBeandestroy()
- 'destroy-method'attribute, then the corresponding method definition in the Bean class will be called.