Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional bean dependencies tracking [SPR-15417] #19979

Closed
spring-projects-issues opened this issue Apr 5, 2017 · 1 comment
Closed

Functional bean dependencies tracking [SPR-15417] #19979

spring-projects-issues opened this issue Apr 5, 2017 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 5, 2017

Sébastien Deleuze opened SPR-15417 and commented

The new functional bean registration mechanism gets the type of the bean to register (via an explicit class parameter in Java or via reified type parameters in Kotlin) but unlike JavaConfig which declare explicitly bean dependencies as input @Bean method parameters, the functional variant don't know what bean dependency are needed because it is based on opaque applicationContext.getBean() invocations performed by the Supplier implementation.

Tracking those applicationContext.getBean() invocations would allow the functional bean registration mechanism to build the same kind of bean dependency graph than with JavaConfig, allowing to cover the same use cases and improving consistency between both approaches.


Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've implemented this through implicit tracking of all bean retrieval operations, effectively triggering a registerDependentBean call for every getBean etc operation from a Supplier callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants