Skip to content

Remove support for Aware interfaces in BeanRegistrar #34562

Closed
@sdeleuze

Description

@sdeleuze

As reported in #34559, it is currently possible to implement BeanClassLoaderAware, BeanFactoryAware, EnvironmentAware and ResourceLoaderAware interfaces with related injection in non AOT mode.

It is not supposed to be supported, as it is too easy to shoot yourself in the foot with a BeanFactory for example with bean retrieval that is not supposed to be invoked in BeanRegistrat#register. As a consequence, I am removing such capability, and am interested into learning about the higher level use cases to potentially address them in a different way.

For example, I am planning to add additional capabilities to implement programmatic conditions via #21497. Feel free to comment on that issue and create a new one to explore additional needs.

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