Package org.jboss.beans.metadata.plugins

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


      String bean1Type = "org.jboss.test.kernel.dependency.classloader.SimpleBeanImpl";
      AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("VFSBean1", bean1Type);
      HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
      attributes1.add(new AbstractPropertyMetaData("string", "String1"));
      metaData1.setProperties(attributes1);
      metaData1.setClassLoader(new AbstractClassLoaderMetaData(vfsCL));

      AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("VFSBean2",
         "org.jboss.test.kernel.dependency.classloader.SimpleBeanWithConstructorClassLoaderImpl");
      HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
      attributes2.add(new AbstractPropertyMetaData("string", "String2"));
      metaData2.setProperties(attributes2);
      metaData2.setClassLoader(new AbstractClassLoaderMetaData(vfsCL));
      ArrayList<ParameterMetaData> constructor2 = new ArrayList<ParameterMetaData>();
      String bean1Iface = "org.jboss.test.kernel.dependency.classloader.SimpleBean";
      AbstractDependencyValueMetaData bean2Depends = new AbstractDependencyValueMetaData("VFSBean1");
      AbstractParameterMetaData param = new AbstractParameterMetaData(bean1Iface, bean2Depends);
      constructor2.add(param);
View Full Code Here


         }
        
         assertNull(metaData.getMetaData(TestAnnotation1.class.getName()));

         cl = new TestClassLoader(getClass().getClassLoader());
         beanMetaData.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData(cl)));
         context = deploy(beanMetaData);
         try
         {
            validate();
            metaData = context.getScopeInfo().getMetaData();
View Full Code Here

         ValueMetaData value = (ValueMetaData) child;
         valueMetaData.setValue(value);
      }
      else if (parent instanceof AbstractClassLoaderMetaData)
      {
         AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent;
         ValueMetaData value = (ValueMetaData) child;
         valueMetaData.setClassLoader(value);
      }
      else if (parent instanceof AbstractConstructorMetaData)
      {
         AbstractConstructorMetaData valueMetaData = (AbstractConstructorMetaData) parent;
         ValueMetaData value = (ValueMetaData) child;
         valueMetaData.setValue(value);
      }
      else if (parent instanceof AbstractBindingMetaData)
      {
         AbstractBindingMetaData valueMetaData = (AbstractBindingMetaData) parent;
         ValueMetaData value = (ValueMetaData) child;
         valueMetaData.setValue(value);
      }
      else
      {
         AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent;
         ValueMetaData value = (ValueMetaData) child;
         valueMetaData.setValue(value);
      }
   }
View Full Code Here

    * @param classLoader the classloader value
    * @return the classloader metadata
    */
   protected ClassLoaderMetaData createClassLoaderMetaData(ValueMetaData classLoader)
   {
      return new AbstractClassLoaderMetaData(classLoader);
   }
View Full Code Here

         {
            // Hack, if it doesn't have a classloader use the "null" classloader
            // we don't want it to gain itself as the classloader
            BeanMetaData classLoaderBean = (BeanMetaData) classLoader;
            if (classLoaderBean.getClassLoader() == null)
               classLoaderBean.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData()));
            result.add((BeanMetaData) classLoader);
         }
      }

      List<BeanMetaDataFactory> factories = getBeanFactories();
      if (factories != null && factories.isEmpty() == false)
      {
         for (BeanMetaDataFactory factory : factories)
         {
            if (factory == null)
               throw new IllegalArgumentException("BeanMetaDataFactory cannot be null.");

            List<BeanMetaData> beans = factory.getBeans();
            if (beans != null && beans.isEmpty() == false)
            {
               for (BeanMetaData bmd : beans)
               {
                  if (bmd == null)
                     throw new IllegalArgumentException("Bean meta data cannot be null.");

                  // check annotations
                  if (annotations != null && annotations.isEmpty() == false)
                  {
                     Set<AnnotationMetaData> annotationsBMD = bmd.getAnnotations();
                     if (annotationsBMD == null)
                     {
                        annotationsBMD = new HashSet<AnnotationMetaData>();
                        bmd.setAnnotations(annotationsBMD);
                     }
                     annotationsBMD.addAll(annotations);
                  }

                  // impl specific
                  if (bmd instanceof AbstractBeanMetaData)
                  {
                     AbstractBeanMetaData bean = (AbstractBeanMetaData)bmd;
                     // set deployment defaults, if not already set per bean
                     if (bean.getCreate() == null && getCreate() != null)
                     {
                        bean.setCreate(getCreate());
                     }
                     if (bean.getStart() == null && getStart() != null)
                     {
                        bean.setStart(getStart());
                     }
                     if (bean.getStop() == null && getStop() != null)
                     {
                        bean.setStop(getStop());
                     }
                     if (bean.getDestroy() == null && getDestroy() != null)
                     {
                        bean.setDestroy(getDestroy());
                     }

                     // controller mode
                     if (bean.getMode() == null && getMode() != null)
                     {
                        bean.setMode(getMode());
                     }
                  }

                  // Use any deployment classloader if present and the bean doesn't have one
                  ClassLoaderMetaData beanClassLoader = bmd.getClassLoader();
                  if (beanClassLoader == null)
                  {
                     ClassLoaderMetaData deploymentClassLoader = getClassLoader();
                     if (deploymentClassLoader != null)
                     {
                        // If the deployment classloader is a bean, replace it with an injection
                        ValueMetaData classLoader = deploymentClassLoader.getClassLoader();
                        if (classLoader instanceof BeanMetaData)
                        {
                           classLoader = new AbstractDependencyValueMetaData(((BeanMetaData) classLoader).getName());
                           beanClassLoader = new AbstractClassLoaderMetaData(classLoader);
                        }
                        else
                        {
                           beanClassLoader = deploymentClassLoader;
                        }
View Full Code Here

    * @param classLoader the classloader value
    * @return the classloader metadata
    */
   protected ClassLoaderMetaData createClassLoaderMetaData(ValueMetaData classLoader)
   {
      return new AbstractClassLoaderMetaData(classLoader);
   }
View Full Code Here

      return this;
   }

   public BeanMetaDataBuilder setClassLoader(Object classLoader)
   {
      beanMetaData.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData(classLoader)));
      return this;
   }
View Full Code Here

   public static final DeploymentClassLoaderInterceptor INTERCEPTOR = new DeploymentClassLoaderInterceptor();
  
   public void add(Object parent, Object child, QName name)
   {
      AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
      AbstractClassLoaderMetaData classloader = (AbstractClassLoaderMetaData) child;
      deployment.setClassLoader(classloader);
      // add classloaders as value beans
      List<BeanMetaDataFactory> beans = deployment.getBeanFactories();
      if (beans == null)
      {
View Full Code Here

         AbstractCollectionMetaData collection = (AbstractCollectionMetaData) parent;
         collection.add(value);
      }
      else if (parent instanceof AbstractClassLoaderMetaData)
      {
         AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent;
         valueMetaData.setClassLoader(value);
      }
      else
      {
         AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent;
         valueMetaData.setValue(value);
      }
   }
View Full Code Here

         AbstractPropertyMetaData valueMetaData = (AbstractPropertyMetaData) parent;
         valueMetaData.setValue(getValue());
      }
      else if (parent instanceof AbstractClassLoaderMetaData)
      {
         AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent;
         valueMetaData.setClassLoader(getValue());
      }
      else
      {
         AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent;
         valueMetaData.setValue(getValue());
      }
   }
View Full Code Here

TOP

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

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.