模块 org.redkale

注释类型 Configuration


  • @Documented
    @Target(TYPE)
    @Retention(RUNTIME)
    public @interface Configuration
    启动服务时的初始化配置,需要结合Resource使用
     @Configuration
     public class MyConfiguration {
    
         @Resource(name = "a")
         BeanA createBeanA() {
             System.out.println("创建一个Bean");
             BeanA bean = new BeanA();
             bean.desc = "auto";
             return bean;
         }
    
         @Resource(name = "b")
         BeanA createBeanA(@Resource(name = "dev.desc") String desc) {
             System.out.println("创建一个Bean");
             BeanA bean = new BeanA();
             bean.desc = name;
             return bean;
         }
     }
    
     

    详情见: https://redkale.org

    从以下版本开始:
    2.8.0
    作者:
    zhangjx