一、背景
在这个类 (org.springframework.context.annotation.ConfigurationClassUtils) 中定义了两种模式

full 模式就是把@Bean 方法声明在常用的配置类中
lite 模式则不声明在配置类中,如果声明在@Component 类中,这种就是 lite 模式,至于其他候选项,可以查看下面这个
org.springframework.context.annotation.ConfigurationClassUtils#isConfigurationCandidate

二、确认是否是配置类候选者流程
三、对比
| 模式 | 配置 | 描述 | 备注 |
|---|---|---|---|
| full | @Configuration + proxyBeanMethods=true | 使用 CGLIB 代理,支持 bean 间引用 | 使用代理就是为了 bean 间引用时直接从容器中获取已存在的单例。 |
| lite | @Component 或 @Configuration + proxyBeanMethods=false | 其中定义的@Bean 方法只是会被当成普通工厂方法 | 不支持 bean 间引用,bean 间引用会创建新的实例 |