直接来到bean实例化的流程:
只对单例非懒加载的bean进行实例化
对单实例的bean进行初始化,其大致流程为:
1、初始化非懒加载的bean(懒汉式单例)
2、初始化后会有一些函数需要进行回调
public void preInstantiateSingletons() throws BeansException {
if (logger.isTraceEnabled()) {
logger.trace("Pre-instantiating singletons in " + this);
}
// Iterate over a copy to allow for init methods which in turn register new bean definitions.
// While this may not be part of the regular factory bootstrap, it does otherwise work fine.
List<String> beanNames = new ArrayList<>(this.beanDefinitionNames);
// Trigger initiali