Package org.jboss.jandex

Examples of org.jboss.jandex.Index


     * @return
     */
    private boolean isJaxwsJseDeployment(final DeploymentUnit unit) {
        final boolean isWarDeployment = DeploymentTypeMarker.isType(DeploymentType.WAR, unit);
        if (isWarDeployment) {
            final Index index = ASHelper.getRootAnnotationIndex(unit);
            final WarMetaData warMetaData = ASHelper.getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY);
            if (warMetaData != null && warMetaData.getWebMetaData() != null) {
                return (ASHelper.selectWebServiceServlets(index, warMetaData.getWebMetaData().getServlets(), true).size() > 0);
            }
        }
View Full Code Here


     * @param jaxws if passed value is <b>true</b> JAXWS servlets list will be returned, otherwise JAXRPC servlets list
     * @return either JAXRPC or JAXWS servlets list
     */
    private static List<ServletMetaData> getWebServiceServlets(final DeploymentUnit unit, final boolean jaxws) {
        final JBossWebMetaData jbossWebMD = getJBossWebMetaData(unit);
        final Index annotationIndex = getRootAnnotationIndex(unit);
        return selectWebServiceServlets(annotationIndex, jbossWebMD.getServlets(), jaxws);
    }
View Full Code Here

               }
           }
       }
   }
   private static List<AnnotationInstance> getAnnotations(final DeploymentUnit unit, final Class<?> annClass) {
       final Index compositeIndex = ASHelper.getRootAnnotationIndex(unit);
       return compositeIndex.getAnnotations(DotName.createSimple(annClass.getName()));
   }
View Full Code Here

  public static Set<EntityHierarchy> createEntityHierarchies(AnnotationBindingContext bindingContext) {
    Set<EntityHierarchy> hierarchies = new HashSet<EntityHierarchy>();

    List<DotName> processedEntities = new ArrayList<DotName>();
    Map<DotName, List<ClassInfo>> classToDirectSubClassMap = new HashMap<DotName, List<ClassInfo>>();
    Index index = bindingContext.getIndex();
    for ( ClassInfo info : index.getKnownClasses() ) {
      if ( !isEntityClass( info ) ) {
        continue;
      }

      if ( processedEntities.contains( info.name() ) ) {
View Full Code Here

                        logger.warn("Could not index class " + classFile.getPathNameRelativeTo(virtualFile) + " in archive '" + virtualFile + "'", e);
                    } finally {
                        VFSUtils.safeClose(inputStream);
                    }
                }
                final Index index = indexer.complete();
                resourceRoot.putAttachment(Attachments.ANNOTATION_INDEX, index);
                logger.tracef("Generated index for archive %s", virtualFile);
            } catch (Throwable t) {
                throw new DeploymentUnitProcessingException("Failed to index deployment root for annotations", t);
            }
View Full Code Here

        Map<ResourceRoot, Index> indexes = new HashMap<ResourceRoot, Index>();
        for (ResourceRoot resourceRoot : allResourceRoots) {
            if (resourceRoot == null)
                continue;

            Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX);
            if (index != null) {
                indexes.put(resourceRoot, index);
            }
        }
        return indexes;
View Full Code Here

        if(ModuleRootMarker.isModuleRoot(deploymentRoot)) {
            allResourceRoots.add(deploymentRoot);
        }
        for (ResourceRoot resourceRoot : allResourceRoots) {
            Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX);
            if (index != null) {
                indexes.add(index);
            }
        }
        deploymentUnit.putAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX, new CompositeIndex(indexes));
View Full Code Here

     * @return The correct BDA for the EJB
     */
    private BeanDeploymentArchiveImpl resolveSessionBeanBda(String ejbClassName, Map<ResourceRoot, BeanDeploymentArchiveImpl> bdaMap, BeanDeploymentArchiveImpl rootBda, Map<ResourceRoot, Index> indexes) {
        final DotName className = DotName.createSimple(ejbClassName);
        for(Map.Entry<ResourceRoot, BeanDeploymentArchiveImpl> entry : bdaMap.entrySet()) {
            final Index index = indexes.get(entry.getKey());
            if(index != null) {
                if(index.getClassByName(className) != null) {
                    return entry.getValue();
                }
            }
        }
        return rootBda;
View Full Code Here

                    indexer.index(inputStream);
                } finally {
                    VFSUtils.safeClose(inputStream);
                }
            }
            final Index index = indexer.complete();
            context.putAttachment(ATTACHMENT_KEY, index);
        } catch(Throwable t) {
            throw new DeploymentUnitProcessingException("Failed to index deployment root for annotations", t);
        }
    }
View Full Code Here

                throw new RuntimeException("Missing PersistenceUnitMetadataImpl (thread local wasn't set)");
            }
            if (jartoScan == null) {
                throw new IllegalArgumentException("Null jar to scan url");
            }
            Index index = getJarFileIndex(jartoScan, pu);
            if (index == null) {
                log.tracef("No classes to scan for annotations in jar '%s'"
                     +" (jars with classes '%s')", jartoScan.getPath(), pu.getAnnotationIndex().keySet());
                return new HashSet<Package>();
            }
            Collection<ClassInfo> allClasses = index.getKnownClasses();
            for (ClassInfo classInfo : allClasses) {
                String className = classInfo.name().toString();
                try {
                    resultClasses.add(pu.getClassLoader().loadClass(className));
                    // TODO:  fix temp classloader (get CFNE on entity class)
View Full Code Here

TOP

Related Classes of org.jboss.jandex.Index

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.