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

Provide a method to retrieve all singleton autowire candidates from the bean factory #34591

Closed
wilkinsona opened this issue Mar 13, 2025 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

Please see spring-projects/spring-boot#44706 for background. It would be useful to have a method similar to SimpleAutowireCandidateResolver.resolveAutowireCandidates(ConfigurableListableBeanFactory, Class<T>) that only considers singleton beans. The key to addressing spring-projects/spring-boot#44706 is to avoid any attempt to create prototype beans.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 13, 2025
@jhoeller jhoeller self-assigned this Mar 13, 2025
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 13, 2025
@jhoeller jhoeller added this to the 6.2.5 milestone Mar 13, 2025
@jhoeller
Copy link
Contributor

I ended up exposing the same arguments as for the overloaded getBeanNamesForType/getBeansOfType variant: includeNonSingletons and allowEagerInit.

@jhoeller
Copy link
Contributor

Reopening for an includeNonSingletons variant of ObjectProvider.stream/orderedStream.

@jhoeller jhoeller reopened this Mar 18, 2025
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

3 participants