Package org.jboss.joinpoint.spi

Examples of org.jboss.joinpoint.spi.Joinpoint


    */
   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();)
         {
            Map.Entry entry = (Map.Entry) i.next();
View Full Code Here


         else
            return null;
      }

      BeanInfo beanInfo = configurator.getBeanInfo(info);
      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 expected.cast(result);
View Full Code Here

         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

         cl = Configurator.getClassLoader(classLoader);
      BeanInfo info = null;
      if (bean != null)
         info = configurator.getBeanInfo(bean, cl, accessMode);

      Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null);
      Object result = joinpoint.dispatch();
      if (info == null && result != null)
         info = configurator.getBeanInfo(result.getClass(), accessMode);

      if (properties != null && properties.size() > 0)
      {
View Full Code Here

      Kernel kernel = controller.getKernel();
      KernelConfigurator configurator = kernel.getConfigurator();

      BeanMetaData metaData = context.getBeanMetaData();
      BeanInfo info = context.getBeanInfo();
      final Joinpoint joinPoint = configurator.getConstructorJoinPoint(info, metaData.getConstructor(), metaData);

      Object object = dispatchJoinPoint(context, joinPoint);
      if (object == null)
         throw new IllegalStateException("Instantiate joinpoint returned a null object: " + joinPoint);
      context.setTarget(object);
View Full Code Here

         cl = Configurator.getClassLoader(classLoader);
      BeanInfo info = null;
      if (bean != null)
         info = configurator.getBeanInfo(bean, cl, accessMode);

      Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null);
      Object result = joinpoint.dispatch();
      if (info == null && result != null)
         info = configurator.getBeanInfo(result.getClass(), accessMode);

      if (properties != null && properties.size() > 0)
      {
View Full Code Here

   public void testGetField() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getFieldGetJoinpoint(bean, jpf, "publicField");
      assertEquals("DefaultValue", joinpoint.dispatch());
   }
View Full Code Here

   public void testMethodInvoke() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getMethodJoinpoint(bean, jpf, "echo", new String[] { String.class.getName() }, new Object[] { "ping" });
      assertEquals("ping", joinpoint.dispatch());
   }
View Full Code Here

   public void testObjectMethodInvoke() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getMethodJoinpoint(bean, jpf, "toString", new String[0], new Object[0]);
      assertEquals(bean.toString(), joinpoint.dispatch());
   }
View Full Code Here

/* 46 */     Kernel kernel = controller.getKernel();
/* 47 */     KernelConfigurator configurator = kernel.getConfigurator();
/*    */
/* 49 */     BeanMetaData metaData = context.getBeanMetaData();
/* 50 */     BeanInfo info = context.getBeanInfo();
/* 51 */     Joinpoint joinPoint = configurator.getConstructorJoinPoint(info, metaData.getConstructor(), metaData);
/*    */
/* 53 */     Object object = dispatchJoinPoint(context, joinPoint);
/* 54 */     if (object == null)
/* 55 */       throw new IllegalStateException("Instantiate joinpoint returned a null object: " + joinPoint);
/* 56 */     context.setTarget(object);
View Full Code Here

TOP

Related Classes of org.jboss.joinpoint.spi.Joinpoint

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.