logo
  • 教程列表
  • SO官方文档
  • Spring Lazy Initialization
    • Spring 中的 Lazy Init 示例
    • 用于元件扫描和自动布线
    • 配置类中的延迟初始化
  1. StackOverflow 文档
  2. spring 教程
  3. Spring Lazy Initialization
  4. 配置类中的延迟初始化

配置类中的延迟初始化

Created: November-22, 2018

@Configuration
// @Lazy - For all Beans to load lazily
public class AppConf {

    @Bean
    @Lazy
    public Demo demo() {
        return new Demo();
    }
}
  • 用于元件扫描和自动布线

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明