Beispiel #1
0
 /**
  * checks if a bean has been seen before in the dependecyPath. If not, it resolves the
  * InjectionPoints and adds the resolved beans to the set of beans to be validated
  */
 private static void reallyValidatePseudoScopedBean(
     Bean<?> bean,
     BeanManagerImpl beanManager,
     Set<Bean<?>> dependencyPath,
     Set<Bean<?>> validatedBeans) {
   // see if we have already seen this bean in the dependency path
   if (dependencyPath.contains(bean)) {
     // create a list that shows the path to the bean
     List<Bean<?>> realDepdencyPath = new ArrayList<Bean<?>>(dependencyPath);
     realDepdencyPath.add(bean);
     throw new DeploymentException(PSEUDO_SCOPED_BEAN_HAS_CIRCULAR_REFERENCES, realDepdencyPath);
   }
   if (validatedBeans.contains(bean)) {
     return;
   }
   dependencyPath.add(bean);
   for (InjectionPoint injectionPoint : bean.getInjectionPoints()) {
     validatePseudoScopedInjectionPoint(
         injectionPoint, beanManager, dependencyPath, validatedBeans);
   }
   validatedBeans.add(bean);
   dependencyPath.remove(bean);
 }