IOC容器 bean生命周期
bean生命周期

constructt method...null
settingg method...spel city
initt method...spel city
BeanLifeCycle{cycle='spel city'} // 这个是 System.out.println(cycle1);
destroyy method...spel city //容器关闭时调用
BeanPostProcessor在init方法前后处理bean
实现 org.springframework.beans.factory.config.BeanPostProcessor
constructt method...null
settingg method...spel city
postProcessBeforeInitialization: bean=BeanLifeCycle{cycle='spel city'} beanName=cycle1
initt method...spel city
postProcessAfterInitialization: bean=BeanLifeCycle{cycle='spel city'} beanName=cycle1
BeanLifeCycle{cycle='spel city'} // 这个是 System.out.println(cycle1);
destroyy method...spel city //容器关闭时调用

Last updated
Was this helpful?