@Override
public ScopeMetadata resolveScopeMetadata(final BeanDefinition definition) {
if (definition instanceof AnnotatedBeanDefinition) {
final AnnotatedBeanDefinition beanDefinition = (AnnotatedBeanDefinition) definition;
final ScopeMetadata metadata = new ScopeMetadata();
final Set<String> annotationTypes = beanDefinition.getMetadata().getAnnotationTypes();
if (annotationTypes.contains(RequestScoped.class
.getName())) {
metadata.setScopeName("request");
metadata.setScopedProxyMode(ScopedProxyMode.TARGET_CLASS);
} else if (annotationTypes
.contains(ApplicationScoped.class.getName())) {
metadata.setScopeName("singleton");
} else {
return super.resolveScopeMetadata(definition);
}
return metadata;
} else {
return super.resolveScopeMetadata(definition);
}
}
CdiScopeMetadataResolver.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:app-ms
作者:
评论列表
文章目录