SpringBoot中bean的生命周期
作者:互联网
-
生命周期
- 实例化 Instantiation
- 属性赋值 Populate
- 初始化 Initialization
- 销毁 Destruction
protected Object doCreateBean(final String beanName, final RootBeanDefinition mbd, final @Nullable Object[] args) throws BeanCreationException { // Instantiate the bean. BeanWrapper instanceWrapper = null; if (instanceWrapper == null) { // 实例化阶段 instanceWrapper = createBeanInstance(beanName, mbd, args); } // Initialize the bean instance. Object exposedObject = bean; try { // 属性赋值阶段 populateBean(beanName, mbd, instanceWrapper); // 初始化阶段 exposedObject = initializeBean(beanName, exposedObject, mbd); } }
标签:exposedObject,生命周期,SpringBoot,mbd,beanName,instanceWrapper,bean,Object 来源: https://www.cnblogs.com/lostxxx/p/16244626.html