Class AnnotationScopeMetadataResolver
java.lang.Object
org.springframework.context.annotation.AnnotationScopeMetadataResolver
- All Implemented Interfaces:
- ScopeMetadataResolver
A 
ScopeMetadataResolver implementation that by default checks for
the presence of Spring's @Scope annotation on the bean class.
The exact type of annotation that is checked for is configurable via
setScopeAnnotationType(Class).
- Since:
- 2.5
- Author:
- Mark Fisher, Juergen Hoeller, Sam Brannen
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a newAnnotationScopeMetadataResolver.AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode) Construct a newAnnotationScopeMetadataResolverusing the supplied defaultScopedProxyMode.
- 
Method SummaryModifier and TypeMethodDescriptionresolveScopeMetadata(BeanDefinition definition) Resolve theScopeMetadataappropriate to the supplied beandefinition.voidsetScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType) Set the type of annotation that is checked for by thisAnnotationScopeMetadataResolver.
- 
Field Details- 
scopeAnnotationType
 
- 
- 
Constructor Details- 
AnnotationScopeMetadataResolverpublic AnnotationScopeMetadataResolver()Construct a newAnnotationScopeMetadataResolver.- See Also:
 
- 
AnnotationScopeMetadataResolverConstruct a newAnnotationScopeMetadataResolverusing the supplied defaultScopedProxyMode.- Parameters:
- defaultProxyMode- the default scoped-proxy mode
 
 
- 
- 
Method Details- 
setScopeAnnotationTypeSet the type of annotation that is checked for by thisAnnotationScopeMetadataResolver.- Parameters:
- scopeAnnotationType- the target annotation type
 
- 
resolveScopeMetadataDescription copied from interface:ScopeMetadataResolverResolve theScopeMetadataappropriate to the supplied beandefinition.Implementations can of course use any strategy they like to determine the scope metadata, but some implementations that spring immediately to mind might be to use source level annotations present on the classof the supplieddefinition, or to use metadata present in theAttributeAccessor.attributeNames()of the supplieddefinition.- Specified by:
- resolveScopeMetadatain interface- ScopeMetadataResolver
- Parameters:
- definition- the target bean definition
- Returns:
- the relevant scope metadata; never null
 
 
-