摘要: 接上回,我们讲到了`refresh()`方法中的`invokeBeanFactoryPostProcessors(beanFactory)`方法主要在执行`BeanFactoryPostProcessor`和其子接口`BeanDefinitionRegistryPostProcessor`的方法。 阅读全文
posted @ 2019-10-16 13:57 Coder小黑 阅读(1104) 评论(0) 推荐(0) 编辑
摘要: 你真的懂Spring Java Config 吗?Full @Configuration 和 lite @Bean mode 是Spring Java Config 里非常有意思的两个概念。 阅读全文
posted @ 2019-10-13 13:59 Coder小黑 阅读(1322) 评论(2) 推荐(3) 编辑
摘要: Spring5源码解析4-refresh方法之invokeBeanFactoryPostProcessors。`getBeanFactoryPostProcessors()`方法获取的是`AbstractApplicationContext#beanFactoryPostProcessors`这个成员变量。这个成员变量只能通过代码中手动编码调用`AbstractApplicationContext#addBeanFactoryPostProcessor`方法来添加新的元素。很明显,我们这里为空。 阅读全文
posted @ 2019-10-10 09:12 Coder小黑 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 接上回分析完`register(annotatedClasses);`后,现在来看一下`refresh();`方法。`refresh();`方法,里面调用了超级多的方法,我们一个个来看。 阅读全文
posted @ 2019-10-09 19:43 Coder小黑 阅读(795) 评论(0) 推荐(0) 编辑
摘要: 上回已经讲完了AnnotationConfigApplicationContext构造器中的this()方法,现在来看register(annotatedClasses)方法。根据传入的class对象创建AnnotatedGenericBeanDefinition,AnnotatedGenericBeanDefinition是BeanDefinition的一个实现类 阅读全文
posted @ 2019-10-08 08:38 Coder小黑 阅读(1262) 评论(0) 推荐(0) 编辑
摘要: 在Java中,一切皆对象。在JDK中使用java.lang.Class来描述类这个对象。在Spring中,存在bean这样一个概念,那Spring又是怎么抽象bean这个概念,用什么类来描述bean这个对象呢? 阅读全文
posted @ 2019-10-07 15:13 Coder小黑 阅读(709) 评论(0) 推荐(0) 编辑
摘要: Spring5源码解析Annotation版本。从最简单的启动容器开始解析源码:new AnnotationConfigApplicationContext(AppConfig.class); 阅读全文
posted @ 2019-10-07 11:00 Coder小黑 阅读(536) 评论(0) 推荐(1) 编辑
摘要: Spring5源码解析前奏,本地构建Spring5源码。 阅读全文
posted @ 2019-10-06 20:42 Coder小黑 阅读(2407) 评论(0) 推荐(0) 编辑