非懒专题

Sping源码(九)—— Bean的初始化(非懒加载)— Bean的创建方式(Supplier)

序言 目前介绍几种Spring创建对象的方式,其中包括 FactoryBean、Cglib动态代理、自定义BeanPostProcessor(InstantiationAwareBeanPostProcessor)。 这篇文章会继续扩展Spring中Bean的创建方式——Supplier。 Supplier 先看下我们的Supplier类,在前面的ObjectFactory中有提到过,类上有

Sping源码(九)—— Bean的初始化(非懒加载)— getMergedLocalBeanDefinition

序言 前两篇文章介绍了Bean初始化之前的一些准备工作,包括设置BeanFacroty的ConversionService属性以及将Bean进行冻结。这篇文章将会进入到preInstantiateSingletons方法。进一步了解Bean的初始化流程。 preInstantiateSingletons public void preInstantiateSingletons() thro

Spring-创建非懒加载的单例Bean源码

补充:关于扫描的逻辑 /*** Scan the class path for candidate components.* @param basePackage the package to check for annotated classes* @return a corresponding Set of autodetected bean definitions*/public Set