Questions tagged [spring-bean-dsl]

6 questions
2
votes
2 answers

Spring Kotlin DSL: get all beans of certain type

Suppose I have an interface Yoyo and different realizations of this interface: interface Yoyo { fun haha() { println("hello world") } } @Component class Yoyo1 : Yoyo @Component class Yoyo2 : Yoyo @Component class Yoyo3 :…
maslick
  • 2,903
  • 3
  • 28
  • 50
0
votes
1 answer

processAot fails on bean definition from Kotlin bean DSL

I have bean DSL as follows: class BeansInitializer : ApplicationContextInitializer { override fun initialize(applicationContext: GenericApplicationContext) { beans { bean { …
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
1 answer

Spring Kotlin Bean DSL - register bean only if other bean is present?

I want to register bean (MyBean) only if another bean (anotherBeanThatShouldBePresent) is present in the context. How I can achieve that? bean { MyBean( anotherBeanThatShouldBePresent = ref() ) }
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
1 answer

Functional bean definition Kotlin DSL - add initializer to single test class?

I have a Spring Boot test that is using Redis and I would like to load only Redis related beans for that test. I have a function that defines beans: fun BeanDefinitionDsl.redisBeans() { bean { // ... } } And I would like to have only…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
1 answer

Order of evaluation in Spring bean definition dsl for kotlin?

I wonder when environment method is being taken into account. Considering following code: bean { Bar(ref()) } // requires bean of type Foo environment( { !activeProfiles.contains("local") }, { ProdFoo() })) environment( {…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
2 answers

Environment variables from Docker are not passed to Spring

I try to dockerize simple java application. my Dockerfile: FROM adoptopenjdk/openjdk11:alpine COPY build/libs/*.jar app.jar ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar /app.jar EXPOSE 8080 In my bean definition file I try to log…
pixel
  • 24,905
  • 36
  • 149
  • 251