
Spring源码解读之ioc容器
mist蒙
这个作者很懒,什么都没留下…
展开
-
spring源码解析之ioc-finishBeanFactoryInitialization
1、首先简单看一下监听器的注册this.registerListeners();注册监听器protected void registerListeners() { Iterator var1 = this.getApplicationListeners().iterator(); while(var1.hasNext()) { ApplicationListener<?> listener = (ApplicationListen原创 2020-12-10 16:07:41 · 189 阅读 · 0 评论 -
spring源码解析之ioc-registerBeanPostProcessors
继续往下走//往下看registerBeanPostProcessors(beanFactory);注册beanPostProcessorsprotected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) { //继续往下看 PostProcessorRegistrationDelegate.registerBeanPostProcessors(beanFactory, this);原创 2020-12-08 18:01:31 · 190 阅读 · 0 评论 -
spring源码解析之ioc-invokeBeanFactoryPostProcessors
接下来本应该是postProcessBeanFactory(beanFactory);但是他是留给子类去做处理的,我们这里没用他的具体业务,所以直接略过我们继续往下走invokeBeanFactoryPostProcessors(beanFactory);执行beanFactoryPostProcessorprotected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {原创 2020-12-08 16:53:00 · 215 阅读 · 1 评论 -
spring源码解析之ioc-prepareBeanFactory
上一篇,我们分析了beanDefinition的定义,接着,我们继续跟着源码,来看看spring ioc在启动阶段都做了什么事还是来贴出核心代码public void refresh() throws BeansException, IllegalStateException { synchronized(this.startupShutdownMonitor) { this.prepareRefresh(); ConfigurableL原创 2020-12-08 16:17:42 · 161 阅读 · 0 评论 -
spring源码解析之ioc-BeanDefinition的加载
BeanDefinition的加载beanDefination的加载主要分为三种1、基于xml配置文件的beanDefinition的加载1、配置文件的读取public static void main(String[] args) { 创建ioc容器 ApplicationContext context = new ClassPathXmlApplicationContext("classpath:app1.xml"); Student student =(St原创 2020-12-04 17:42:05 · 253 阅读 · 0 评论