java类javax.faces.bean.NoneScoped的实例源码

JsfScopeAnnotationsAutoConfiguration.java 文件源码 项目:joinfaces 阅读 22 收藏 0 点赞 0 评论 0
@Bean
@ConditionalOnProperty(value = "jsf.scope-configurer.jsf.enabled", havingValue = "true", matchIfMissing = true)
public static BeanFactoryPostProcessor jsfScopeAnnotationsConfigurer(Environment environment) {
    CustomScopeAnnotationConfigurer scopeAnnotationConfigurer = new CustomScopeAnnotationConfigurer();

    scopeAnnotationConfigurer.setOrder(environment.getProperty("jsf.scope-configurer.jsf.order", Integer.class, Ordered.LOWEST_PRECEDENCE));

    scopeAnnotationConfigurer.addMapping(NoneScoped.class, ConfigurableBeanFactory.SCOPE_PROTOTYPE);
    scopeAnnotationConfigurer.addMapping(RequestScoped.class, WebApplicationContext.SCOPE_REQUEST);
    scopeAnnotationConfigurer.addMapping(javax.faces.bean.ViewScoped.class, ViewScope.SCOPE_VIEW);
    scopeAnnotationConfigurer.addMapping(javax.faces.view.ViewScoped.class, ViewScope.SCOPE_VIEW);
    scopeAnnotationConfigurer.addMapping(SessionScoped.class, WebApplicationContext.SCOPE_SESSION);
    scopeAnnotationConfigurer.addMapping(ApplicationScoped.class, WebApplicationContext.SCOPE_APPLICATION);

    return scopeAnnotationConfigurer;
}
JsfClassFactory.java 文件源码 项目:joinfaces 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Ignore ViewScoped, SessionScoped, RequestScoped and NoneScoped annotations
 * because spring will take care of them.
 * @return set of annotations to exclude from handlesType
 */
private Set<Class<? extends Annotation>> annotationsToExclude() {
    Set<Class<? extends Annotation>> result = new HashSet<>();
    if (this.jsfAnnotatedClassFactoryConfiguration.isExcludeScopedAnnotations()) {
        result.add(ViewScoped.class);
        result.add(SessionScoped.class);
        result.add(RequestScoped.class);
        result.add(NoneScoped.class);
    }
    return result;
}


问题


面经


文章

微信
公众号

扫码关注公众号