Package org.jboss.metadata.spi.scope

Examples of org.jboss.metadata.spi.scope.ScopeFactoryLookup


   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      if (scope != null)
      {
         Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(scope, cl);
         ScopeFactoryLookup scopeFactoryLookup = annotation.getClass().getAnnotation(ScopeFactoryLookup.class);
         if (scopeFactoryLookup != null)
         {
            // TODO do we really want to create a new factory for every annotation we look at?
            // We could use some kind of soft reference map here (per classloader)
            // Class<?> clazz = scopeFactoryLookup.value();
            // WeakHashMap.put(clazz.getClassLoader(), new SoftMap())
            // SoftValueHashMap.put(clazz.getName(), instance)
            // If this is done, it should be moved to a common helper class
            // that does generic construction from a factory given on the meta annotations
            ScopeFactory scopeFactory = scopeFactoryLookup.value().newInstance();
            return scopeFactory.create(annotation);
         }
         else
         {
            // todo - annotation.value();
View Full Code Here


            Collection<Scope> scopes = new HashSet<Scope>();
            for (Annotation annotation : annotations)
            {
               if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
               {
                  ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
                  ScopeFactory scf = getScopeFactory(sfl.value());
                  Scope scope = scf.create(annotation);
                  scopes.add(scope);
               }
            }
            if (scopes.size() > 0)
View Full Code Here

            Collection<Scope> scopes = new HashSet<Scope>();
            for (Annotation annotation : annotations)
            {
               if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
               {
                  ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
                  ScopeFactory scf = getScopeFactory(sfl.value());
                  Scope scope = scf.create(annotation);
                  scopes.add(scope);
               }
            }
            if (scopes.size() > 0)
View Full Code Here

   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      if (scope != null)
      {
         Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(scope, cl);
         ScopeFactoryLookup scopeFactoryLookup = annotation.getClass().getAnnotation(ScopeFactoryLookup.class);
         if (scopeFactoryLookup != null)
         {
            // TODO do we really want to create a new factory for every annotation we look at?
            // We could use some kind of soft reference map here (per classloader)
            // Class<?> clazz = scopeFactoryLookup.value();
            // WeakHashMap.put(clazz.getClassLoader(), new SoftMap())
            // SoftValueHashMap.put(clazz.getName(), instance)
            // If this is done, it should be moved to a common helper class
            // that does generic construction from a factory given on the meta annotations
            ScopeFactory scopeFactory = scopeFactoryLookup.value().newInstance();
            return scopeFactory.create(annotation);
         }
         else
         {
            // todo - annotation.value();
View Full Code Here

   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      if (scope != null)
      {
         Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(scope, cl);
         ScopeFactoryLookup scopeFactoryLookup = annotation.getClass().getAnnotation(ScopeFactoryLookup.class);
         if (scopeFactoryLookup != null)
         {
            // TODO do we really want to create a new factory for every annotation we look at?
            // We could use some kind of soft reference map here (per classloader)
            // Class<?> clazz = scopeFactoryLookup.value();
            // WeakHashMap.put(clazz.getClassLoader(), new SoftMap())
            // SoftValueHashMap.put(clazz.getName(), instance)
            // If this is done, it should be moved to a common helper class
            // that does generic construction from a factory given on the meta annotations
            ScopeFactory scopeFactory = scopeFactoryLookup.value().newInstance();
            return scopeFactory.create(annotation);
         }
         else
         {
            // todo - annotation.value();
View Full Code Here

            Collection<Scope> scopes = new HashSet<Scope>();
            for (Annotation annotation : annotations)
            {
               if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
               {
                  ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
                  Scope scope = sfl.value().newInstance().create(annotation);
                  scopes.add(scope);
               }
            }
            if (scopes.size() > 0)
            {
View Full Code Here

            Collection<Scope> scopes = new HashSet<Scope>();
            for (Annotation annotation : annotations)
            {
               if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
               {
                  ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
                  ScopeFactory<Annotation> scf = (ScopeFactory) sfl.value().newInstance();
                  Scope scope = scf.create(annotation);
                  scopes.add(scope);
               }
            }
            if (scopes.size() > 0)
View Full Code Here

/*  91 */         Collection scopes = new HashSet();
/*  92 */         for (Annotation annotation : annotations)
/*     */         {
/*  94 */           if (!annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
/*     */             continue;
/*  96 */           ScopeFactoryLookup sfl = (ScopeFactoryLookup)annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
/*  97 */           Scope scope = ((ScopeFactory)sfl.value().newInstance()).create(annotation);
/*  98 */           scopes.add(scope);
/*     */         }
/*     */
/* 101 */         if (scopes.size() > 0)
/*     */         {
View Full Code Here

/*     */     throws Throwable
/*     */   {
/*  61 */     if (this.scope != null)
/*     */     {
/*  63 */       Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(this.scope, cl);
/*  64 */       ScopeFactoryLookup scopeFactoryLookup = (ScopeFactoryLookup)annotation.getClass().getAnnotation(ScopeFactoryLookup.class);
/*  65 */       if (scopeFactoryLookup != null)
/*     */       {
/*  74 */         ScopeFactory scopeFactory = (ScopeFactory)scopeFactoryLookup.value().newInstance();
/*  75 */         return scopeFactory.create(annotation);
/*     */       }
/*     */
/*  80 */       return createScopeKey(annotation.getClass().getSimpleName(), annotation.toString());
/*     */     }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.scope.ScopeFactoryLookup

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.