public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
ScopeMetadata metadata = new ScopeMetadata();
if (definition instanceof AnnotatedBeanDefinition) {
AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
Map<String, Object> attributes =
annDef.getMetadata().getAnnotationAttributes(this.scopeAnnotationType.getName());
if (attributes != null) {
metadata.setScopeName((String) attributes.get("value"));
ScopedProxyMode proxyMode = (ScopedProxyMode) attributes.get("proxyMode");
if (proxyMode == null || proxyMode == ScopedProxyMode.DEFAULT) {
proxyMode = this.defaultProxyMode;