Spring Bean Lifecycle
2020-05-22 14:52:42 0 举报
spring ioc启动,bean的生命周期
作者其他创作
大纲/内容
实例化 createBeanInstance()
填充 populateBean()
ApplicationContextAwareProcessor#invokeAwareInterfaces()
执行BeanFactoryPostProcessor#postProcessBeanFactory
BeanFactoryPostProcessor
doCreateBean
EnvironmentAware EmbeddedValueResolverAware ResourceLoaderAware ApplicationEventPublisherAware MessageSourceAware ApplicationContextAware
执行:BeanPostProcessor#postProcessBeforeInitialization
initializeBean()
填充bean:AbstractAutowireCapableBeanFactory#populateBean
执行AbstractAutowireCapableBeanFactory#doCreateBean
InitDestroyAnnotationBeanPostProcessor执行@PreDestroy
调用aware:invokeAwareMethods
PropertyPlaceholderConfigurer#doProcessProperties() 占位符${}解析
BeanNameAware BeanFactoryAware
执行:InitializingBean#afterPropertiesSet
执行:DisposableBean#destroy
实例化bean:AbstractAutowireCapableBeanFactory#createBeanInstance
执行:BeanPostProcessor#postProcessAfterInitialization
InitDestroyAnnotationBeanPostProcessor执行@PostConstruct
0 条评论
下一页