-
@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