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

  • 關於本站
  • 免責聲明