Exemplo n.º 1
0
 /** finds pseudo beans and adds them to the list of beans to be validated */
 private static void validatePseudoScopedInjectionPoint(
     InjectionPoint ij,
     BeanManagerImpl beanManager,
     Set<Bean<?>> dependencyPath,
     Set<Bean<?>> validatedBeans) {
   Set<Bean<?>> resolved = beanManager.getBeans(ij);
   try {
     Bean<? extends Object> bean = beanManager.resolve(resolved);
     if (bean != null) {
       if (!(bean instanceof AbstractBuiltInBean<?>)) {
         boolean normalScoped =
             beanManager
                 .getServices()
                 .get(MetaAnnotationStore.class)
                 .getScopeModel(bean.getScope())
                 .isNormal();
         if (!normalScoped) {
           reallyValidatePseudoScopedBean(bean, beanManager, dependencyPath, validatedBeans);
         }
       }
     }
   } catch (AmbiguousResolutionException e) {
     // this is handled by another validator
   }
 }
Exemplo n.º 2
0
 /**
  * Checks to make sure that pseudo scoped beans (i.e. @Dependent scoped beans) have no circular
  * dependencies
  */
 private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
   reallyValidatePseudoScopedBean(
       bean, beanManager, new LinkedHashSet<Bean<?>>(), new HashSet<Bean<?>>());
 }