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