Skip to content

Provide a non-@Component-sterotype annotation that tags a bean class to be scanned fro @Bean annotations [SPR-5795] #10465

@spring-projects-issues

Description

@spring-projects-issues

Mark Kralj-Taylor opened SPR-5795 and commented

Spring component-scanning discovers @Component stereotype annotated classes.
One thing that Spring does for these 'components' is to scan the class for @Bean annotations.

We have a use-case where we want a bean's class to be scanned for @Bean annotations, but without the bean being @Component stereotype annotated.

  • We want Spring to scan for @Bean annotations in the class for some beans configured in explicitly (esp in XML config) to Spring.

Please can spring provide a new annotation that:

  • marks a class so Spring scans it for @Bean annotations, when it is used as a Spring bean
  • without making the class eligible for component-scanning

Our specific use case is where Spring beans have internal components that Spring needs to know about so they can be detected by JMX exporting.


Affects: 3.0 M3

Referenced from: commits b8c1130

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