Skip to content

Introduce getBeanProvider variants with allowEagerInit flag #25559

Closed
@jhoeller

Description

@jhoeller

Triggered by gh-24644, the unique capabilities of getBeanProvider (which include stream-based access to generic type matches as well as ordered stream access) are useful for many purposes but miss a key ingredient from the simpler ListableBeanFactory retrieval methods: namely the ability to suppress eager initialization for type checks. Introducing dedicated getBeanProvider variants with an allowEagerInit flag at ListableBeanFactory level closes that gap without introducing the concept of eager/lazy type initialization at the basic BeanFactory level (where no other such methods with an allowEagerInit flag exist).

There is also an includeNonSingletons flag on those ListableBeanFactory retrieval methods which we are not mirroring here since it is less useful in general and potentially irritating in terms of semantics for the full set of ObjectProvider retrieval methods.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions