Provide InjectionPoint inside Spring functional bean definition DSL #27738
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Meta information about the class or method that is requesting an instance of a managed bean
should be available when using Spring's functional bean definition DSL.
This might be the corresponding
InjectionPoint
or at least the class name of the requesting instance.One can use a Bean factory function to allow injection of Logger objects into ones Beans, e.g.:
This is not possible with the functional bean definition DSL in Kotlin.
Neither of the two examples down below work in the most recent version of Spring, unfortunately.
See also this unanswered question of StackOverflow.
The injection into the factory functions seems to be possible since SPR-14033 / #18605.
A minimal reproduction repository can be found on GitHub.
Run
./gradlew bootRun
or.\gradlew.bat bootRun
on Windows to reproduce the error.The text was updated successfully, but these errors were encountered: