Examples of AnnotationRepository


Examples of org.jboss.jca.common.spi.annotations.repository.AnnotationRepository

        try {
            // Annotation merging
            Annotations annotator = new Annotations();
            Map<ResourceRoot, Index> indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
            for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
                AnnotationRepository repository = new JandexAnnotationRepositoryImpl(entry.getValue(), classLoader);
                    cmd = annotator.merge(cmd, repository, classLoader);
            }
            // FIXME: when the connector is null the Iron Jacamar data is ignored
            if (cmd != null) {
                // Validate metadata
View Full Code Here

Examples of org.jboss.jca.common.spi.annotations.repository.AnnotationRepository

        try {
            // Annotation merging
            Annotations annotator = new Annotations();
            Map<ResourceRoot, Index> indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
            for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
                AnnotationRepository repository = new JandexAnnotationRepositoryImpl(entry.getValue(), classLoader);
                    cmd = annotator.merge(cmd, repository, classLoader);
            }
            // FIXME: when the connector is null the Iron Jacamar data is ignored
            if (cmd != null) {
                // Validate metadata
View Full Code Here

Examples of org.jboss.mcann.AnnotationRepository

         configureScanner(unit, scanner, config);
         if (configuration != null)
            config.merge(configuration); // override with custom config
         scanner.setConfiguration(config);

         AnnotationRepository repository = scanner.scan(unit.getClassLoader(), urls);
         unit.addAttachment(AnnotationRepository.class, repository);
      }
      catch (Exception e)
      {
         throw DeploymentException.rethrowAsDeploymentException("Exception visiting module", e);
View Full Code Here

Examples of org.jboss.mcann.AnnotationRepository

         return true;

      boolean result = false;
      for(VirtualFile root : roots)
      {
         AnnotationRepository env = createAnnotationRepository(root);
         for (Class<? extends Annotation> annotationClass : candidateAnnotations)
         {
            if (env.hasClassAnnotatedWith(annotationClass))
            {
               result = true;
               for (CandidateAnnotationsCallback callback : callbacks)
                  callback.executeCallback(root, context, env, annotationClass);
            }
View Full Code Here

Examples of org.jboss.mcann.AnnotationRepository

      {
         DefaultAnnotationScanner scanner = new ModuleAnnotationScanner(deployment);
         if (configuration != null)
            scanner.setConfiguration(configuration);
        
         AnnotationRepository repository = scanner.scan(unit.getClassLoader());
         unit.addAttachment(AnnotationRepository.class, repository);
      }
      catch (Exception e)
      {
         throw DeploymentException.rethrowAsDeploymentException("Cannot create AR", e);
View Full Code Here

Examples of org.jboss.papaki.AnnotationRepository

      if (cmd == null || cmd.is16())
      {
         AnnotationScanner annotationScanner =
            AnnotationScannerFactory.getStrategy(AnnotationScannerFactory.JAVASSIST_INPUT_STREAM);
         annotationScanner.configure().constructorLevel(false).parameterLevel(false);
         AnnotationRepository annotationRepository = annotationScanner.scan(urls, cl);

         boolean isMetadataComplete = false;
         if (cmd != null && cmd instanceof JCA16Base)
         {
            JCA16Base jmd = (JCA16Base)cmd;
View Full Code Here

Examples of org.jboss.scanning.annotations.spi.AnnotationRepository

   @SuppressWarnings("unchecked")
   protected Collection<Class<?>> getClasses(VFSDeploymentUnit unit, AbstractCreator creator)
   {
      boolean trace = log.isTraceEnabled();

      AnnotationRepository env = unit.getAttachment(AnnotationIndex.class);
      if (env == null)
      {
         if (trace)
            log.trace("Cannot scan classes, missing AnnotationRepository as attachment: " + unit.getName());
         return Collections.emptySet();
      }

      String creatorInfo = creator.toString();
      AnnotationContext context = creator.getAnnotationContext();
      Set<Class<?>> classes = new HashSet<Class<?>>();

      Collection<Class<? extends Annotation>> typeAnnotations = context.getTypeAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", type annotations: " + typeAnnotations);
      for(Class<? extends Annotation> annotation : typeAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
         for(Element<Annotation, Class<?>> elt : elements)
               classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> methodAnnotations = context.getMethodAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", method annotations: " + methodAnnotations);
      for(Class<? extends Annotation> annotation : methodAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Method>> elements = env.classHasMethodAnnotatedWith(annotationClass);
         for(Element<Annotation, Method> elt : elements)
            classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> fieldAnnotations = context.getFieldAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", field annotations: " + fieldAnnotations);
      for(Class<? extends Annotation> annotation : fieldAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Field>> elements = env.classHasFieldAnnotatedWith(annotationClass);
         for(Element<Annotation, Field> elt : elements)
            classes.add(elt.getOwner());
      }

      if (trace)
View Full Code Here

Examples of org.jboss.scanning.annotations.spi.AnnotationRepository

   }

   @SuppressWarnings("unchecked")
   protected Collection<Class<?>> getClasses(VFSDeploymentUnit unit, String mainClassName, List<VirtualFile> classpath) throws IOException
   {
      AnnotationRepository env = unit.getAttachment(AnnotationRepository.class);
      if (env == null)
      {
         if (log.isTraceEnabled())
            log.trace("Cannot scan classes, missing AnnotationRepository as attachment: " + unit.getName());
         return Collections.emptySet();
      }

      Set<Class<?>> classes = new HashSet<Class<?>>();
      for(Class<? extends Annotation> annotation : annotationOnClass)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
         for(Element<Annotation, Class<?>> elt : elements)
            classes.add(elt.getOwner());
      }
      for(Class<? extends Annotation> annotation : annotationOnMethod)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Method>> elements = env.classHasMethodAnnotatedWith(annotationClass);
         for(Element<Annotation, Method> elt : elements)
            classes.add(elt.getOwner());
      }
      for(Class<? extends Annotation> annotation : annotationOnField)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Field>> elements = env.classHasFieldAnnotatedWith(annotationClass);
         for(Element<Annotation, Field> elt : elements)
            classes.add(elt.getOwner());
      }

      if(log.isTraceEnabled() && classes.isEmpty() == false)
View Full Code Here

Examples of org.jboss.scanning.annotations.spi.AnnotationRepository

         return true;

      boolean result = false;
      for(VirtualFile root : roots)
      {
         AnnotationRepository env = createAnnotationRepository(root);
         for (Class<? extends Annotation> annotationClass : candidateAnnotations)
         {
            if (env.hasClassAnnotatedWith(annotationClass))
            {
               result = true;
               for (CandidateAnnotationsCallback callback : callbacks)
                  callback.executeCallback(root, context, env, annotationClass);
            }
View Full Code Here

Examples of org.jboss.scanning.annotations.spi.AnnotationRepository

         return true;

      boolean result = false;
      for(VirtualFile root : roots)
      {
         AnnotationRepository env = createAnnotationRepository(root);
         for (Class<? extends Annotation> annotationClass : candidateAnnotations)
         {
            if (env.hasClassAnnotatedWith(annotationClass))
            {
               result = true;
               for (CandidateAnnotationsCallback callback : callbacks)
                  callback.executeCallback(root, context, env, annotationClass);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.