CustomScopeAnnotationConfigurer.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:joinfaces 作者:
/**
 * Checks how is bean defined and deduces scope name from JSF CDI annotations.
 *
 * @param definition beanDefinition
 */
private void registerJsfCdiToSpring(BeanDefinition definition) {

    if (definition instanceof AnnotatedBeanDefinition) {
        AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;

        String scopeName = null;
        // firstly check whether bean is defined via configuration
        if (annDef.getFactoryMethodMetadata() != null) {
            scopeName = deduceScopeName(annDef.getFactoryMethodMetadata());
        }
        else {
            // fallback to type
            scopeName = deduceScopeName(annDef.getMetadata());
        }

        if (scopeName != null) {
            definition.setScope(scopeName);

            log.debug("{} - Scope({})", definition.getBeanClassName(), scopeName.toUpperCase());
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号