Package org.jboss.beans.metadata.spi

Examples of org.jboss.beans.metadata.spi.ConstructorMetaData


      return checkAnnotationRepositoryForWeldAnnotationOnInjectionPoints(unit, beanMetaData);
   }
  
   private boolean checkBeanMetaDataForWeldAnnotationOverridesOnInjectionPoints(Controller controller, DeploymentUnit unit, BeanMetaData beanMetaData)
   {
      ConstructorMetaData con = beanMetaData.getConstructor();
      if (con != null)
      {
         if (hasWeldAnnotation(unit, con))
            return true;
      }
View Full Code Here


   {
      boolean trace = log.isTraceEnabled();
      if (trace)
         log.trace("Instantiating info=" + info + " metaData=" + metaData);

      ConstructorMetaData constructor = null;
      if (metaData != null)
         constructor = metaData.getConstructor();
      Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData);
      return joinPoint.dispatch();
   }
View Full Code Here

   @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter"})
   public Object getBean(String name, Object[] parameters) throws BeansException
   {
      AbstractBeanFactory result = getExactBean(name, AbstractBeanFactory.class);
      ConstructorMetaData cmd = result.getConstructor();

      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Temp");
      for (Object parameter : parameters )
         builder.addConstructorParameter(null, parameter);
      ConstructorMetaData tempCMD = builder.getBeanMetaData().getConstructor();

      synchronized (result)
      {
         result.setConstructor(tempCMD);
         try
View Full Code Here

   {
      boolean trace = log.isTraceEnabled();
      if (trace)
         log.trace("Instantiating info=" + info + " metaData=" + metaData);

      ConstructorMetaData constructor = null;
      if (metaData != null)
         constructor = metaData.getConstructor();
      Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData);
      return joinPoint.dispatch();
   }
View Full Code Here

      flushJBossObjectCache();
   }

   public void initialVisit(MetaDataVisitor visitor)
   {
      ConstructorMetaData constructor = getConstructor();
      if (getBean() == null)
      {
         if (isAbstract() == false && getParent() == null)
         {
            if (constructor == null)
               throw new IllegalArgumentException("Bean should have a class attribute or a constructor element.");
            if (constructor.getFactoryMethod() == null)
            {
               if (constructor.getValue() == null)
                  throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have either a factoryMethod attribute or embedded value.");
            }
            else if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
               throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have one of a factoryClass attribute or a factory element, or embedded value.");
         }
      }
      else
      {
View Full Code Here

   @XmlTransient
   public BeanMetaData getBeanMetaData()
   {
      if (getBean() == null)
      {
         ConstructorMetaData constructor = getConstructor();
         if (constructor == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         if (constructor.getFactoryMethod() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a factoryMethod attribute.");
         if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a either a factoryClass attribute or a factory element.");
      }

      if (getFactoryClass() == null)
         setFactoryClass(GenericBeanFactory.class.getName());
View Full Code Here

public class FactoryTestCase extends AbstractXMLTest
{
   protected AbstractValueMetaData getFactory(String name) throws Exception
   {
      AbstractBeanMetaData bean = unmarshalBean(name);
      ConstructorMetaData constructor = bean.getConstructor();
      assertNotNull(constructor);
      ValueMetaData factory = constructor.getFactory();
      assertNotNull(factory);
      assertTrue(factory instanceof AbstractValueMetaData);
      return (AbstractValueMetaData) factory;
   }
View Full Code Here

public class FactoryJaxbTestCase extends AbstractMCTest
{
   protected AbstractValueMetaData getFactory() throws Exception
   {
      AbstractBeanMetaData bean = unmarshalBean();
      ConstructorMetaData constructor = bean.getConstructor();
      assertNotNull(constructor);
      ValueMetaData factory = constructor.getFactory();
      assertNotNull(factory);
      assertTrue(factory instanceof AbstractValueMetaData);
      return (AbstractValueMetaData) factory;
   }
View Full Code Here

public class AnnotationTestCase extends AbstractXMLTest
{
   protected AbstractAnnotationMetaData getAnnotation(String name) throws Exception
   {
      AbstractBeanMetaData bean = unmarshalBean(name);
      ConstructorMetaData constructor = bean.getConstructor();
      assertNotNull(constructor);
      Set<AnnotationMetaData> annotations = constructor.getAnnotations();
      assertEquals(1, annotations.size());
      AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) annotations.iterator().next();
      assertNotNull(annotation);
      return annotation;
   }
View Full Code Here

      assertList(constructor.getValue());
   }

   public void testConstructorWithSet() throws Exception
   {
      ConstructorMetaData constructor = getConstructor("ConstructorWithSet.xml");
      assertNull(constructor.getFactoryClass());
      assertNull(constructor.getFactoryMethod());
      assertNull(constructor.getAnnotations());
      assertNull(constructor.getFactory());
      assertNull(constructor.getParameters());
      assertSet(constructor.getValue());
   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.metadata.spi.ConstructorMetaData

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.