先上结论
1-InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation...
2-SmartInstantiationAwareBeanPostProcessor.determineCandidateConstructors...
Soldier 构造方法...
3-MergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition...
4-InstantiationAwareBeanPostProcessor.postProcessAfterInstantiation...
5-InstantiationAwareBeanPostProcessor.postProcessProperties...
BeanNameAware.setBeanName:soldier...
BeanFactoryAware.setBeanFactory...
ResourceLoaderAware.setResourceLoader...
ApplicationEventPublisherAware.setApplicationEventPublisher...
MessageSourceAware.setMessageSource...
ApplicationContextAware.setApplicationContext.......
@PostConstruct
6-BeanPostProcessor.postProcessBeforeInitialization...
InitializingBean.afterPropertiesSet...
7-BeanPostProcessor.postProcessAfterInitialization...
2020-01-04 18:25:05.897 DEBUG org.springframework.context.support.AbstractApplicationContext 1002 doClose - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@de3a06f, started on Sat Jan 04 18:25:05 CST 2020
@PreDestroy...
8-DestructionAwareBeanPostProcessor.postProcessBeforeDestruction...
DisposableBean.destroy...
测试代码如下
@Component
public class Soldier implements ApplicationContextAware, DisposableBean, BeanNameAware
, BeanFactoryAware, MessageSourceAware, ApplicationEventPu