Skip to content

Support custom base scope annotation type for @Bean methods [SPR-13280] #17870

@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-13280 and commented

Status Quo

AnnotationScopeMetadataResolver supports custom scope annotation types via its scopeAnnotationType property, and ConfigurationClassBeanDefinitionReader internally uses an AnnotationScopeMetadataResolver for certain uses cases (see its scopeMetadataResolver 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 to org.springframework.context.annotation.Scope.


Deliverables

  1. Determine why the scope annotation type in ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod() is hard coded to org.springframework.context.annotation.Scope.
    • See TODO in ConfigurationClassBeanDefinitionReader.
  2. Support custom scope annotation types consistently throughout ConfigurationClassBeanDefinitionReader.

Affects: 4.0 GA

Issue Links:

Referenced from: commits f0ac278, aae0bd2

1 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions