-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Support custom base scope annotation type for @Bean methods [SPR-13280] #17870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented This is actually intentional: We could open this up to support method-level annotations, I suppose, but then we'd also have to pass a custom Overall, the use of completely custom scope annotations isn't very compelling with configuration classes where plenty of Spring-specific annotations have to be used anyway. It should be good enough to allow for composable scope annotations, meta-annotated with Spring's Juergen |
Sam Brannen commented I was mainly just curious about why the difference existed (and I admittedly did not investigate it fully on my own), but now it makes sense. Thanks for the detailed explanation. |
Leonard Loesche commented It looks like the Meta-Annotation for |
Juergen Hoeller commented Leonard Loesche, this issue here is just about the use of a different base scope annotation type, not about meta-annotating with Spring's standard If Juergen |
Leonard Loesche commented Thank you, for your quick answer! |
Juergen Hoeller commented Resolving this as "Won't Fix" for the time being, since it's not clear why the use of Spring's Juergen |
Sam Brannen opened SPR-13280 and commented
Status Quo
AnnotationScopeMetadataResolver
supports custom scope annotation types via itsscopeAnnotationType
property, andConfigurationClassBeanDefinitionReader
internally uses anAnnotationScopeMetadataResolver
for certain uses cases (see itsscopeMetadataResolver
field).However,
ConfigurationClassBeanDefinitionReader
does not consistently support custom scope annotation types for all use cases. For example,ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod()
hard codes the scope annotation type toorg.springframework.context.annotation.Scope
.Deliverables
ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod()
is hard coded toorg.springframework.context.annotation.Scope
.TODO
inConfigurationClassBeanDefinitionReader
.ConfigurationClassBeanDefinitionReader
.Affects: 4.0 GA
Issue Links:
@Bean
methods (with ASM-based scanning)Referenced from: commits f0ac278, aae0bd2
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: