public ExplicitBeanArchiveMetadataContainer(Map<ResourceRoot, ExplicitBeanArchiveMetadata> beanArchiveMetadata) { this.beanArchiveMetadata = ImmutableMap.copyOf(beanArchiveMetadata); }
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = moduleClassLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { WeldLogger.DEPLOYMENT_LOGGER.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
public BeanDeploymentModule(String moduleId, DeploymentUnit deploymentUnit, Collection<BeanDeploymentArchiveImpl> beanDeploymentArchives) { this.beanDeploymentArchives = ImmutableSet.copyOf(beanDeploymentArchives); for (BeanDeploymentArchiveImpl bda : beanDeploymentArchives) { bda.addBeanDeploymentArchives(beanDeploymentArchives); } this.moduleDescriptor = WeldEEModuleDescriptor.of(moduleId, deploymentUnit); if (moduleDescriptor != null) { addService(EEModuleDescriptor.class, moduleDescriptor); } }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
@Override public ListIterator<E> listIterator(int index) { if (index < 0 || index > elements.length) { throw indexOutOfBoundsException(index); } return new ListIteratorImpl(index); }
@Override public ListIterator<E> listIterator(int index) { if (index == 0 || index == 1) { return new SingletonIterator(index); } throw indexOutOfBoundsException(index); }
private Set<String> getImplicitBeanClasses(Index index, ResourceRoot resourceRoot) { Set<String> implicitBeanClasses = new HashSet<String>(); for (AnnotationType beanDefiningAnnotation : beanDefiningAnnotations) { List<AnnotationInstance> annotationInstances = index.getAnnotations(beanDefiningAnnotation.getName()); for (ClassInfo classInfo : Indices.getAnnotatedClasses(annotationInstances)) { implicitBeanClasses.add(Indices.CLASS_INFO_TO_FQCN.apply(classInfo)); } } // Make all explicit components into implicit beans so they will support injection for(ComponentDescription description : components.componentDescriptions.get(resourceRoot)) { if(!components.implicitComponentDescriptions.contains(description)) { implicitBeanClasses.add(description.getComponentClassName()); } } return implicitBeanClasses; }
public Components(DeploymentUnit deploymentUnit, Map<ResourceRoot, Index> indexes) { componentDescriptionProcessors = ServiceLoader.load(ComponentDescriptionProcessor.class, WildFlySecurityManager.getClassLoaderPrivileged(BeanArchiveProcessor.class)); for (ComponentDescription component : deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION).getComponentDescriptions()) { ResourceRoot resourceRoot = null; DotName componentClassName = DotName.createSimple(component.getComponentClassName()); for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) { final Index index = entry.getValue(); if (index != null) { if (index.getClassByName(componentClassName) != null) { resourceRoot = entry.getKey(); break; } } } if (resourceRoot == null) { implicitComponentDescriptions.add(component); } if (resourceRoot == null || isClassesRoot(resourceRoot)) { // special handling resourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); } componentDescriptions.put(resourceRoot, component); // Process component descriptions for (ComponentDescriptionProcessor processor : componentDescriptionProcessors) { processor.processComponentDescription(resourceRoot, component); } } }
for (Entry<ResourceRoot, Collection<ComponentDescription>> entry : components.componentDescriptions.entrySet()) { BeanDeploymentArchiveImpl bda = bdaMap.get(entry.getKey()); String id = null;
public static <X> Set<ParameterInjectionPoint<?, X>> filterOutSpecialParameterInjectionPoints(List<ParameterInjectionPoint<?, X>> injectionPoints) { ImmutableSet.Builder<ParameterInjectionPoint<?, X>> filtered = ImmutableSet.builder(); for (ParameterInjectionPoint<?, X> parameter : injectionPoints) { if (parameter instanceof SpecialParameterInjectionPoint) { continue; } filtered.add(parameter); } return filtered.build(); }
@Override public ListIterator<E> listIterator(int index) { if (index < 0 || index > elements.length) { throw indexOutOfBoundsException(index); } return new ListIteratorImpl(index); }
@Override public ListIterator<E> listIterator(int index) { if (index == 0 || index == 1) { return new SingletonIterator(index); } throw indexOutOfBoundsException(index); }
public static <X> Set<InjectionPoint> filterOutSpecialParameterInjectionPoints(List<ParameterInjectionPoint<?, X>> injectionPoints) { ImmutableSet.Builder<InjectionPoint> filtered = ImmutableSet.builder(); for (ParameterInjectionPoint<?, X> parameter : injectionPoints) { if (parameter instanceof SpecialParameterInjectionPoint) { continue; } filtered.add(parameter); } return filtered.build(); }
@Override public ListIterator<E> listIterator(int index) { if (index < 0 || index > elements.length) { throw indexOutOfBoundsException(index); } return new ListIteratorImpl(index); }
@Override public ListIterator<E> listIterator(int index) { if (index == 0 || index == 1) { return new SingletonIterator(index); } throw indexOutOfBoundsException(index); }
public static <X> Set<InjectionPoint> filterOutSpecialParameterInjectionPoints(List<ParameterInjectionPoint<?, X>> injectionPoints) { ImmutableSet.Builder<InjectionPoint> filtered = ImmutableSet.builder(); for (ParameterInjectionPoint<?, X> parameter : injectionPoints) { if (parameter instanceof SpecialParameterInjectionPoint) { continue; } filtered.add(parameter); } return filtered.build(); }
@Override public ListIterator<E> listIterator(int index) { if (index < 0 || index > elements.length) { throw indexOutOfBoundsException(index); } return new ListIteratorImpl(index); }