Examples of BeanInfo


Examples of org.jboss.beans.info.spi.BeanInfo

         throw new Error("Should not be here - dependency failed! " + this);
      Object result = context.getTarget();
      if (result != null && property != null)
      {
         KernelConfigurator configurator = controller.getKernel().getConfigurator();
         BeanInfo beanInfo = configurator.getBeanInfo(result.getClass());
         TargettedJoinpoint joinpoint = configurator.getPropertyGetterJoinPoint(beanInfo, property);
         joinpoint.setTarget(result);
         return joinpoint.dispatch();
      }
      return result;
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

            return null;
         // Try to use the passed type
         typeInfo = info;
      }
     
      BeanInfo beanInfo = configurator.getBeanInfo(typeInfo.getType());
      Joinpoint constructor = configurator.getConstructorJoinPoint(beanInfo);
      Object result = constructor.dispatch();
      if (expected.isAssignableFrom(result.getClass()) == false)
         throw new ClassCastException(result.getClass() + " is not a " + expected.getName());
      return result;
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

            return null;
         // Try to use the passed type
         typeInfo = info;
      }

      BeanInfo beanInfo = configurator.getBeanInfo(typeInfo.getType());
      Joinpoint constructor = configurator.getConstructorJoinPoint(beanInfo);
      Object result = constructor.dispatch();
      if (expected.isAssignableFrom(result.getClass()) == false)
         throw new ClassCastException(result.getClass() + " is not a " + expected.getName());
      return result;
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

   protected SimpleBean configureSimpleBean(String name, Object value) throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelConfigurator configurator = kernel.getConfigurator();
      BeanInfo info = configurator.getBeanInfo(SimpleBean.class);
      SimpleBean bean = (SimpleBean) instantiate(configurator, info);

      AbstractPropertyMetaData metaData = new AbstractPropertyMetaData(name, value);
     
      configure(configurator, bean, info, metaData);
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

      return joinPoint.dispatch();
   }
  
   protected void configure(KernelConfigurator configurator, Object bean, BeanMetaData metaData) throws Throwable
   {
      BeanInfo info = configurator.getBeanInfo(metaData);
      configure(configurator, bean, info, metaData);
   }
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

      BigDecimal bigDecimalValue = new BigDecimal("12e4");
      BigInteger bigIntegerValue = new BigInteger("123456");

      Kernel kernel = bootstrap();
      KernelConfigurator configurator = kernel.getConfigurator();
      BeanInfo info = configurator.getBeanInfo(SimpleBean.class);
      SimpleBean bean = (SimpleBean) instantiate(configurator, info);

      AbstractBeanMetaData metaData = new AbstractBeanMetaData();
      HashSet attributes = new HashSet();
      attributes.add(new AbstractPropertyMetaData("aString", stringValue));
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

      assertEquals("B string", result2);
   }

   protected MethodJoinpoint getMethodJoinpoint(KernelConfig config, Class clazz, String string) throws Throwable
   {
      BeanInfo info = config.getBeanInfo(clazz);
      JoinpointFactory jpf = info.getJoinpointFactory();
      return Config.getMethodJoinpoint(null, jpf, string, null, null);
   }
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

   public void testSimpleInstantiateFromBeanInfo() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelConfigurator configurator = kernel.getConfigurator();
      BeanInfo info = configurator.getBeanInfo(SimpleBean.class);

      SimpleBean bean = (SimpleBean) instantiate(configurator, info);
      assertEquals("()", bean.getConstructorUsed());
   }
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

    * @throws Throwable for any error
    */
   public Object createBean() throws Throwable
   {
      ClassLoader cl = Configurator.getClassLoader(classLoader);
      BeanInfo info = configurator.getBeanInfo(bean, cl);
      Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null);
      Object result = joinpoint.dispatch();
      if (properties != null && properties.size() > 0)
      {
         for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
View Full Code Here

Examples of org.jboss.beans.info.spi.BeanInfo

         ClassInfo classInfo = classAdapter.getClassInfo();
         String className = classInfo.getName();
         Map map = (Map) cache.get(cl);
         if (map != null)
         {
            BeanInfo info = (BeanInfo) map.get(className);
            if (info != null)
               return info;
         }

         if (classInfo.isInterface())
            throw new IllegalArgumentException(classInfo.getName() + " is an interface");

         Set constructors = getConstructors(classInfo);
         Set methods = getMethods(classInfo);
         Set properties = getProperties(methods);
         Set events = getEvents(classInfo);
        
         BeanInfo result = createBeanInfo(classAdapter, properties, constructors, methods, events);
         if (map == null)
         {
            map = new WeakValueHashMap();
            cache.put(cl, map);
         }
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.