Package org.jboss.beans.metadata.plugins

Examples of org.jboss.beans.metadata.plugins.AbstractListMetaData


      super(ListValue.class);
   }

   public ValueMetaData createValueMetaData(ListValue annotation)
   {
      AbstractListMetaData list = new AbstractListMetaData();
      if (isAttributePresent(annotation.clazz()))
         list.setType(annotation.clazz().getName());
      if (isAttributePresent(annotation.elementClass()))
         list.setElementType(annotation.elementClass().getName());
      for(Value value : annotation.value())
         list.add(createValueMetaData(value));
      return list;
   }
View Full Code Here


         public Object startElement(Object parent, QName name, ElementBinding element)
         {
            if (collectionQName.equals(name))
               return new AbstractCollectionMetaData();
            else if (listQName.equals(name))
               return new AbstractListMetaData();
            else if (setQName.equals(name))
               return new AbstractSetMetaData();
            else if (arrayQName.equals(name))
               return new AbstractArrayMetaData();
            else
View Full Code Here

   }
  
   @SuppressWarnings("unchecked")
   public List<ValueMetaData> createList(String listType, String elementType)
   {
      AbstractListMetaData collection = new AbstractListMetaData();
      if (listType != null)
         collection.setType(listType);
      if (elementType != null)
         collection.setElementType(elementType);
      return (List) collection;
   }
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   public List<ValueMetaData> createList(String listType, String elementType)
   {
      AbstractListMetaData collection = new AbstractListMetaData();
      if (listType != null)
         collection.setType(listType);
      if (elementType != null)
         collection.setElementType(elementType);
      return (List) collection;
   }
View Full Code Here

      // Add any dependencies based on @DependsOn/depends-on elements
      JBossSessionBean31MetaData sessionBeanMetaData = (JBossSessionBean31MetaData) container.getMetaData();
      String[] dependsOn = sessionBeanMetaData.getDependsOn();
      if (dependsOn != null)
      {
         AbstractListMetaData containerDependencies = new AbstractListMetaData();
         EjbLinkResolver ejbLinkResolver = new EjbLinkResolver();
         for (String dependency : dependsOn)
         {
            // resolve the EJB through the ejb link in depends-on
            JBossEnterpriseBeanMetaData dependencyBean = ejbLinkResolver.resolveEJB(dependency, unit);
            if (dependencyBean == null)
            {
               throw new RuntimeException("Could not resolve bean for @DependsOn/depends-on with ejb-name: "
                     + dependency + " while processing EJB named " + container.getEJBName());
            }
            if (isSingletonBean(dependencyBean) == false)
            {
               throw new RuntimeException("@DependsOn/depends-on can only refer to Singleton beans. "
                     + dependencyBean.getEjbClass() + " is not a singleton bean");
            }
            // when a singleton bean depends on the other singleton bean, we add:
            // 1) A dependency on the target EJB container. This we do by injecting the target EJB container
            // into this container being installed. The injected target containers will then be used
            // to instantiate the target @Depends bean (at the appropriate time)
            // 2) A dependency on each of the exposed JNDI names of the target EJB (so that the
            // target EJB can be accessed through JNDI within the dependent EJB)
           
            // get the exposed JNDI names
            List<String> jndiNames = this.getExposedJNDINames((JBossSessionBean31MetaData) dependencyBean);
            for (String jndiName : jndiNames)
            {
               // add each jndi name as a dependency
               // Note: The dependency resolution of a dependency with prefix JNDIKernelRegistryPlugin.JNDI_DEPENDENCY_PREFIX
               // is handled by JNDIKernelRegistryPlugin, which does a JNDI lookup to see if the dependency is resolved.
               // Effectively, none of the MC beans have to add the jndi name as an explicit supply. So when the
               // corresponding jndi binder binds this jndi name to JNDI tree, the dependency will be marked as resolved
               containerDependencyPolicy.addDependency(JNDIKernelRegistryPlugin.JNDI_DEPENDENCY_PREFIX + jndiName);
            }
            String dependencyBeanContainerName = dependencyBean.getContainerName();
            // create a @Inject
            AbstractInjectionValueMetaData containerDependencyInjection = new AbstractInjectionValueMetaData(dependencyBeanContainerName);
            // add the @Inject to a list which will then be set on the container
            containerDependencies.add(containerDependencyInjection);
         }
         // add the list of @Inject(s)
         containerBMDBuilder.addPropertyMetaData("singletonDependsOn", containerDependencies);
      }
View Full Code Here

   public Object startElement(Object parent, QName name, ElementBinding element)
   {
      String typeName = element.getQName().getLocalPart();
      if ("list".equals(typeName))
         return new AbstractListMetaData();
      else if ("set".equals(typeName))
         return new AbstractSetMetaData();
      else
         throw new IllegalArgumentException("Unsupported collection type=" + typeName);
   }
View Full Code Here

/* 40 */     super(ListValue.class);
/*    */   }
/*    */
/*    */   public ValueMetaData createValueMetaData(ListValue annotation)
/*    */   {
/* 45 */     AbstractListMetaData list = new AbstractListMetaData();
/* 46 */     if (isAttributePresent(annotation.clazz()))
/* 47 */       list.setType(annotation.clazz());
/* 48 */     if (isAttributePresent(annotation.elementClass()))
/* 49 */       list.setElementType(annotation.elementClass());
/* 50 */     for (Value value : annotation.value())
/* 51 */       list.add(createValueMetaData(value));
/* 52 */     return list;
/*    */   }
View Full Code Here

/*     */     {
/*  81 */       BeanMetaDataUtil.setSimpleProperty(binding, "cflow", this.cflow);
/*     */     }
/*  83 */     this.util.setAspectManagerProperty(binding, "manager");
/*  84 */     result.add(binding);
/*     */     AbstractListMetaData almd;
/*     */     int i;
/*  86 */     if (this.interceptors.size() > 0)
/*     */     {
/*  88 */       almd = new AbstractListMetaData();
/*  89 */       i = 0;
/*  90 */       for (BaseInterceptorData interceptor : this.interceptors)
/*     */       {
/*  92 */         AbstractBeanMetaData bmd = new AbstractBeanMetaData(interceptor.getBeanClassName());
/*  93 */         String intName = this.name + "$" + i++;
/*  94 */         bmd.setName(intName);
/*  95 */         this.util.setAspectManagerProperty(bmd, "manager");
/*  96 */         BeanMetaDataUtil.DependencyBuilder builder = new BeanMetaDataUtil.DependencyBuilder(bmd, "binding", this.name).setState("Instantiated");
/*  97 */         BeanMetaDataUtil.setDependencyProperty(builder);
/*     */
/*  99 */         if ((interceptor instanceof AdviceData))
/*     */         {
/* 101 */           BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName());
/* 102 */           BeanMetaDataUtil.setDependencyProperty(db);
/* 103 */           if (((AdviceData)interceptor).getAdviceMethod() != null)
/*     */           {
/* 105 */             BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
/*     */           }
/* 107 */           BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
/*     */         }
/*     */         else
/*     */         {
/* 111 */           BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "stack", interceptor.getRefName());
/* 112 */           BeanMetaDataUtil.setDependencyProperty(db);
/*     */         }
/* 114 */         result.add(bmd);
/* 115 */         almd.add(new AbstractInjectionValueMetaData(intName));
/* 116 */         BeanMetaDataUtil.setSimpleProperty(binding, "advices", almd);
/*     */       }
/*     */     }
/*     */
/* 120 */     return result;
View Full Code Here

/*  77 */     BeanMetaDataUtil.setSimpleProperty(binding, "name", this.name);
/*  78 */     binding.setBean(ArrayBinding.class.getName());
/*  79 */     BeanMetaDataUtil.setSimpleProperty(binding, "type", this.type);
/*  80 */     this.util.setAspectManagerProperty(binding, "manager");
/*  81 */     result.add(binding);
/*     */     AbstractListMetaData almd;
/*     */     int i;
/*  83 */     if (this.interceptors.size() > 0)
/*     */     {
/*  85 */       almd = new AbstractListMetaData();
/*  86 */       i = 0;
/*  87 */       for (BaseInterceptorData interceptor : this.interceptors)
/*     */       {
/*  89 */         AbstractBeanMetaData bmd = new AbstractBeanMetaData(interceptor.getBeanClassName());
/*  90 */         String intName = this.name + "$" + i++;
/*  91 */         bmd.setName(intName);
/*  92 */         this.util.setAspectManagerProperty(bmd, "manager");
/*  93 */         BeanMetaDataUtil.DependencyBuilder builder = new BeanMetaDataUtil.DependencyBuilder(bmd, "binding", this.name).setState("Instantiated");
/*  94 */         BeanMetaDataUtil.setDependencyProperty(builder);
/*     */
/*  96 */         if ((interceptor instanceof AdviceData))
/*     */         {
/*  98 */           BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName());
/*  99 */           BeanMetaDataUtil.setDependencyProperty(db);
/* 100 */           if (((AdviceData)interceptor).getAdviceMethod() != null)
/*     */           {
/* 102 */             BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
/*     */           }
/* 104 */           BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
/*     */         }
/*     */         else
/*     */         {
/* 108 */           BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "stack", interceptor.getRefName());
/* 109 */           BeanMetaDataUtil.setDependencyProperty(db);
/*     */         }
/* 111 */         result.add(bmd);
/* 112 */         almd.add(new AbstractInjectionValueMetaData(intName));
/* 113 */         BeanMetaDataUtil.setSimpleProperty(binding, "advices", almd);
/*     */       }
/*     */     }
/*     */
/* 117 */     return result;
View Full Code Here

/* 129 */     return result;
/*     */   }
/*     */
/*     */   public static void addInterfaces(AbstractBeanMetaData introduction, String propertyName, String interfaces)
/*     */   {
/* 134 */     AbstractListMetaData lmd = new AbstractListMetaData();
/* 135 */     lmd.setType(ArrayList.class.getName());
/* 136 */     lmd.setElementType(String.class.getName());
/* 137 */     BeanMetaDataUtil.setSimpleProperty(introduction, propertyName, lmd);
/*     */
/* 139 */     StringTokenizer tok = new StringTokenizer(interfaces, ",");
/* 140 */     while (tok.hasMoreTokens())
/*     */     {
/* 142 */       String token = tok.nextToken();
/* 143 */       lmd.add(new StringValueMetaData(token.trim()));
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.metadata.plugins.AbstractListMetaData

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.