|
|
|
@ -35,7 +35,6 @@ import org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostPr |
|
|
|
import org.springframework.beans.factory.config.BeanDefinition; |
|
|
|
import org.springframework.beans.factory.config.BeanDefinition; |
|
|
|
import org.springframework.beans.factory.config.BeanDefinitionHolder; |
|
|
|
import org.springframework.beans.factory.config.BeanDefinitionHolder; |
|
|
|
import org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader; |
|
|
|
import org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader; |
|
|
|
import org.springframework.beans.factory.parsing.ProblemReporter; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.parsing.SourceExtractor; |
|
|
|
import org.springframework.beans.factory.parsing.SourceExtractor; |
|
|
|
import org.springframework.beans.factory.support.AbstractBeanDefinitionReader; |
|
|
|
import org.springframework.beans.factory.support.AbstractBeanDefinitionReader; |
|
|
|
import org.springframework.beans.factory.support.BeanDefinitionReader; |
|
|
|
import org.springframework.beans.factory.support.BeanDefinitionReader; |
|
|
|
@ -51,7 +50,6 @@ import org.springframework.core.io.Resource; |
|
|
|
import org.springframework.core.io.ResourceLoader; |
|
|
|
import org.springframework.core.io.ResourceLoader; |
|
|
|
import org.springframework.core.type.AnnotationMetadata; |
|
|
|
import org.springframework.core.type.AnnotationMetadata; |
|
|
|
import org.springframework.core.type.MethodMetadata; |
|
|
|
import org.springframework.core.type.MethodMetadata; |
|
|
|
import org.springframework.core.type.classreading.MetadataReaderFactory; |
|
|
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -79,10 +77,6 @@ class ConfigurationClassBeanDefinitionReader { |
|
|
|
|
|
|
|
|
|
|
|
private final SourceExtractor sourceExtractor; |
|
|
|
private final SourceExtractor sourceExtractor; |
|
|
|
|
|
|
|
|
|
|
|
private final ProblemReporter problemReporter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final MetadataReaderFactory metadataReaderFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ResourceLoader resourceLoader; |
|
|
|
private final ResourceLoader resourceLoader; |
|
|
|
|
|
|
|
|
|
|
|
private final Environment environment; |
|
|
|
private final Environment environment; |
|
|
|
@ -99,14 +93,11 @@ class ConfigurationClassBeanDefinitionReader { |
|
|
|
* to populate the given {@link BeanDefinitionRegistry}. |
|
|
|
* to populate the given {@link BeanDefinitionRegistry}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry, SourceExtractor sourceExtractor, |
|
|
|
ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry, SourceExtractor sourceExtractor, |
|
|
|
ProblemReporter problemReporter, MetadataReaderFactory metadataReaderFactory, |
|
|
|
|
|
|
|
ResourceLoader resourceLoader, Environment environment, BeanNameGenerator importBeanNameGenerator, |
|
|
|
ResourceLoader resourceLoader, Environment environment, BeanNameGenerator importBeanNameGenerator, |
|
|
|
ImportRegistry importRegistry) { |
|
|
|
ImportRegistry importRegistry) { |
|
|
|
|
|
|
|
|
|
|
|
this.registry = registry; |
|
|
|
this.registry = registry; |
|
|
|
this.sourceExtractor = sourceExtractor; |
|
|
|
this.sourceExtractor = sourceExtractor; |
|
|
|
this.problemReporter = problemReporter; |
|
|
|
|
|
|
|
this.metadataReaderFactory = metadataReaderFactory; |
|
|
|
|
|
|
|
this.resourceLoader = resourceLoader; |
|
|
|
this.resourceLoader = resourceLoader; |
|
|
|
this.environment = environment; |
|
|
|
this.environment = environment; |
|
|
|
this.importBeanNameGenerator = importBeanNameGenerator; |
|
|
|
this.importBeanNameGenerator = importBeanNameGenerator; |
|
|
|
@ -243,8 +234,6 @@ class ConfigurationClassBeanDefinitionReader { |
|
|
|
|
|
|
|
|
|
|
|
// Consider scoping
|
|
|
|
// Consider scoping
|
|
|
|
ScopedProxyMode proxyMode = ScopedProxyMode.NO; |
|
|
|
ScopedProxyMode proxyMode = ScopedProxyMode.NO; |
|
|
|
// TODO [SPR-13280] Determine why type is hard coded to org.springframework.context.annotation.Scope,
|
|
|
|
|
|
|
|
// since AnnotationScopeMetadataResolver supports a custom scope annotation type.
|
|
|
|
|
|
|
|
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, Scope.class); |
|
|
|
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, Scope.class); |
|
|
|
if (attributes != null) { |
|
|
|
if (attributes != null) { |
|
|
|
beanDef.setScope(attributes.getAliasedString("value", Scope.class, configClass.getResource())); |
|
|
|
beanDef.setScope(attributes.getAliasedString("value", Scope.class, configClass.getResource())); |
|
|
|
|