How to use “Functional bean definition Kotlin DSL” with Spring Boot and Spring WebFlux?

后端 未结 3 1268
执笔经年
执笔经年 2021-02-05 19:12

At https://github.com/spring-projects/spring-framework/blob/master/spring-context/src/main/kotlin/org/springframework/context/support/BeanDefinitionDsl.kt the comment shows how

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 20:07

    You can define your beans in *Config.kt file and implement initalize method of ApplicationContextInitializer interface.

    override fun initialize(applicationContext: GenericApplicationContext) {
        ....
    }
    

    Some bean definition here.

    bean("xService")
    
    bean("beanName") {
            BeanConstructor(ref("refBeanName"))
    }
    

提交回复
热议问题