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

用于元件扫描和自动布线

Created: November-22, 2018

@Component
@Lazy
public class Demo {
    ....
    ....
}

@Component
public class B {

    @Autowired
    @Lazy // If this is not here, Demo will still get eagerly instantiated to satisfy this request.
    private Demo demo;

    .......
 }
  • 配置类中的延迟初始化
  • Spring 中的 Lazy Init 示例

Copyright © 2018. All right reserved

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

  • 关于我们
  • 免责声明