Skip to content

Introduce bean definition attribute for enforcing an interface-based proxy #35293

@jhoeller

Description

@jhoeller

Following up on #35286, another gap turned up: While there is a PRESERVE_TARGET_CLASS_ATTRIBUTE for enforcing a target class proxy for a specific bean definition (in case of the bean getting proxied in the first place), there is no way to enforce an interface-based proxy. The new EXPOSED_INTERFACES_ATTRIBUTE (declared in AutoProxyUtils) allows for suggesting an interface Class or Class[] for a specific bean definition, or an empty array signalling all implemented interfaces to be proxied (also available as ALL_INTERFACES_ATTRIBUTE_VALUE constant).

We intend to build on this for the annotated component model, suggesting such a proxy hint next to @Bean and @Component declarations.

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