ApplicationContext_Runtime
2017-06-09 23:18:43 6 举报
Spring ApplicationContext
作者其他创作
大纲/内容
getBean()
refresh()
BeanPostProcessor
FactoryBeanRegistrySupport
与BeanFactory不同,ApplicationContext在容器启动的时候,就会马上对所有的“singleton的bean定义”进行实例化操作。
InstantiationAwareBeanPostProcessor
publishcorresponding event
refresh流程???
postProcessBeanFactory
BeanFactoryPostProcessor
postProcessBeanFactory();
Executor
void execute(Runnable command);
prepareBeanFactory(beanFactory)
ApplicationEvent
ApplicationContext
prepareRefresh()
BeanDefinitionRegistryPostProcessor
Abstract-ApplicationEventMulticaster
ApplicationContext容器启动(初始化)
refreshinternal bean factory
Check for listener beans and register them
SyncTaskExecutor
void execute(Runnable task);
AbstractApplicationContext
ApplicationListener
onApplicationEvent(E event);
initPropertySources();
EventListener
该类的postProcessBeforeInitialization()集中设置了ApplicationContext的各种Aware
Simple-ApplicationEventMulticaster
Executor taskExecutor;void multicastEvent(ApplicationEvent event);
ContextRefreshedEvent
InitializeApplicationEventMulticaster
ApplicationContextAwareProcessor
ConfigurableApplicationContext;
AbstractBeanFactory
Initializeother special beans
Instantiate all remaining (non-lazy-init) singletons
SmartInstantiationAwareBeanPostProcessor
参看ApplocationContext_Models图
CustomEditorConfigurer
MergedBeanDefinitionPostProcessor
RequestHandledEvent
Abstract-ApplicationContext
...Set s;ApplicationEventMulticaster;...
registerBean-PostProcessors
TaskExecutor
invokeBeanFactory-PostProcessors
PropertyResourceConfigurer
int order;
与BeanFactory初始化一样
ApplicationEventMulticaster
void multicastEvent(ApplicationEvent );
ContextClosedEvent
EventObject
Initialize MessageSource
ApplicationEventPublisher
ServletRequestHandledEvent
收藏
收藏
0 条评论
下一页