private Set<ViewDescription> getViews() { final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(EE_APPLICATION_DESCRIPTION); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final Set<ViewDescription> componentsForViewName; if (beanName != null) { componentsForViewName = applicationDescription.getComponents(beanName, typeName, deploymentRoot.getRoot()); } else { componentsForViewName = applicationDescription.getComponentsForViewName(typeName, deploymentRoot.getRoot()); } return componentsForViewName; }
private void setupDependencies(final EJBComponentDescription description, final EEApplicationDescription applicationDescription, final ResourceRoot deploymentRoot, final String[] annotationValues) throws DeploymentUnitProcessingException { for (final String annotationValue : annotationValues) { final Set<ComponentDescription> components = applicationDescription.getComponents(annotationValue, deploymentRoot.getRoot()); if (components.isEmpty()) { throw EjbLogger.ROOT_LOGGER.failToFindEjbRefByDependsOn(annotationValue, description.getComponentClassName()); } else if (components.size() != 1) { throw EjbLogger.ROOT_LOGGER.failToCallEjbRefByDependsOn(annotationValue, description.getComponentClassName(), components); } final ComponentDescription component = components.iterator().next(); description.addDependency(component.getStartServiceName()); if (description instanceof SingletonComponentDescription) { ((SingletonComponentDescription)description).getDependsOn().add(component.getStartServiceName()); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf(description.getEJBName() + " bean is dependent on " + component.getComponentName()); } } } } }
private Set<ViewDescription> getViews() { final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(EE_APPLICATION_DESCRIPTION); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final Set<ViewDescription> componentsForViewName; if (beanName != null) { componentsForViewName = applicationDescription.getComponents(beanName, typeName, deploymentRoot.getRoot()); } else { componentsForViewName = applicationDescription.getComponentsForViewName(typeName, deploymentRoot.getRoot()); } return componentsForViewName; }
private void setupDependencies(final EJBComponentDescription description, final EEApplicationDescription applicationDescription, final ResourceRoot deploymentRoot, final String[] annotationValues) throws DeploymentUnitProcessingException { for (final String annotationValue : annotationValues) { final Set<ComponentDescription> components = applicationDescription.getComponents(annotationValue, deploymentRoot.getRoot()); if (components.isEmpty()) { throw MESSAGES.failToFindEjbRefByDependsOn(annotationValue, description.getComponentClassName()); } else if (components.size() != 1) { throw MESSAGES.failToCallEjbRefByDependsOn(annotationValue, description.getComponentClassName(), components); } final ComponentDescription component = components.iterator().next(); description.addDependency(component.getStartServiceName(), DependencyType.REQUIRED); if (description instanceof SingletonComponentDescription) { ((SingletonComponentDescription)description).getDependsOn().add(component.getStartServiceName()); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf(description.getEJBName() + " bean is dependent on " + component.getComponentName()); } } } } }
private ViewDescription getViewDescription(EJB ejb, InjectionPoint injectionPoint) { final Set<ViewDescription> viewService; if (ejb.beanName().isEmpty()) { if (ejb.beanInterface() != Object.class) { viewService = applicationDescription.getComponentsForViewName(ejb.beanInterface().getName(), deploymentRoot); } else { viewService = applicationDescription.getComponentsForViewName(getType(injectionPoint.getType()).getName(), deploymentRoot); } } else { if (ejb.beanInterface() != Object.class) { viewService = applicationDescription.getComponents(ejb.beanName(), ejb.beanInterface().getName(), deploymentRoot); } else { viewService = applicationDescription.getComponents(ejb.beanName(), getType(injectionPoint.getType()).getName(), deploymentRoot); } } if (injectionPoint.getAnnotated().isAnnotationPresent(Produces.class)) { if (viewService.isEmpty()) { throw WeldLogger.ROOT_LOGGER.ejbNotResolved(ejb, injectionPoint.getMember()); } else if (viewService.size() > 1) { throw WeldLogger.ROOT_LOGGER.moreThanOneEjbResolved(ejb, injectionPoint.getMember(), viewService); } } else { if (viewService.isEmpty()) { return null; } else if (viewService.size() > 1) { return null; } } return viewService.iterator().next(); }
viewService = applicationDescription.getComponents(ejb.beanName(), ejb.beanInterface().getName(), deploymentRoot); } else { viewService = applicationDescription.getComponents(ejb.beanName(), getType(injectionPoint.getType()).getName(), deploymentRoot);