Package org.jboss.beans.metadata.plugins.factory

Examples of org.jboss.beans.metadata.plugins.factory.GenericBeanFactory


      ControllerContext context2 = assertInstall(1, "Name2");
     
      SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget();
      assertNotNull(bean1);

      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean();
      assertNotNull(bean2);
     
      assertEquals(1, bean1.createOrder);
      assertEquals(2, bean1.startOrder);
      assertEquals(3, bean2.createOrder);
View Full Code Here


      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget();
      assertNotNull(bean1);
     
      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean();
      assertNotNull(bean2);
     
      assertEquals(1, bean1.createOrder);
      assertEquals(2, bean1.startOrder);
      assertEquals(3, bean2.createOrder);
View Full Code Here

      ControllerContext context2 = assertInstall(1, "Name2");
     
      SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget();
      assertNotNull(bean1);
     
      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean();
      assertNotNull(bean2);
     
      assertEquals(1, bean1.createOrder);
      assertEquals(2, bean1.startOrder);
      assertEquals(3, bean2.createOrder);
      assertEquals(4, bean2.startOrder);
     
      uninstall("Name1");
      assertContext("Name2", ControllerState.CONFIGURED);

      assertEquals(5, bean1.stopOrder);
      assertEquals(6, bean1.destroyOrder);

      context1 = assertInstall(0, "Name1");
     
      bean1 = (SimpleBeanWithLifecycle) context1.getTarget();
      assertNotNull(bean1);
      assertContext("Name2", ControllerState.INSTALLED);
     
      assertEquals(7, bean1.createOrder);
      assertEquals(8, bean1.startOrder);
     
      uninstall("Name2");
      assertContext("Name1", ControllerState.INSTALLED);

      assertEquals(-1, bean1.stopOrder);
      assertEquals(-1, bean1.destroyOrder);

      context2 = assertInstall(1, "Name2");
     
      factory = (GenericBeanFactory) context2.getTarget();
      bean2 = (SimpleBeanWithLifecycle) factory.createBean();
      assertNotNull(bean2);
      assertContext("Name1", ControllerState.INSTALLED);
     
      assertEquals(9, bean2.createOrder);
      assertEquals(10, bean2.startOrder);
View Full Code Here

      demandDependencyCorrectOrder();
     
      ControllerContext context1 = assertInstall(0, "Name1");     
      ControllerContext context2 = assertInstall(1, "Name2");     
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBean bean2 = (SimpleBean) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
   }
View Full Code Here

     
      ControllerContext context2 = assertInstall(1, "Name2", ControllerState.NOT_INSTALLED);     
      ControllerContext context1 = assertInstall(0, "Name1");     
      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBean bean2 = (SimpleBean) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
   }
View Full Code Here

      demandDependencyReinstall();
     
      ControllerContext context1 = assertInstall(0, "Name1");     
      ControllerContext context2 = assertInstall(1, "Name2");     
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBean bean2 = (SimpleBean) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());

      assertUninstall("Name1");
      assertEquals(ControllerState.ERROR, context1.getState());
      assertEquals(ControllerState.NOT_INSTALLED, context2.getState());

      assertNotInstalled("Name2");
      assertContext("Name2", ControllerState.NOT_INSTALLED);
     
      context1 = assertInstall(0, "Name1");     
      assertNotNull(context1);
      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      factory1 = (GenericBeanFactory) context1.getTarget();
      bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      factory2 = (GenericBeanFactory) context2.getTarget();
      bean2 = (SimpleBean) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());

      assertUninstall("Name2");
      assertEquals(ControllerState.INSTALLED, context1.getState());
      assertEquals(ControllerState.ERROR, context2.getState());
     
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      context2 = assertInstall(1, "Name2");
     
      factory1 = (GenericBeanFactory) context1.getTarget();
      bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      factory2 = (GenericBeanFactory) context2.getTarget();
      bean2 = (SimpleBean) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
   }
View Full Code Here

      constructorDependencyCorrectOrder();

      ControllerContext context1 = assertInstall(0, "Name1");
      ControllerContext context2 = assertInstall(1, "Name2");
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
   }
View Full Code Here

      ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED);
     
      ControllerContext context1 = assertInstall(0, "Name1");
      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
   }
View Full Code Here

      constructorDependencyReinstall();

      ControllerContext context1 = assertInstall(0, "Name1");
      ControllerContext context2 = assertInstall(1, "Name2");
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());

      assertUninstall("Name1");
      assertEquals(ControllerState.ERROR, context1.getState());
      assertEquals(ControllerState.INSTANTIATED, context2.getState());

      assertNotInstalled("Name2");

      context2 = assertContext("Name2", ControllerState.INSTANTIATED);
     
      context1 = assertInstall(0, "Name1");
      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      factory1 = (GenericBeanFactory) context1.getTarget();
      bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      factory2 = (GenericBeanFactory) context2.getTarget();
      bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
     
      assertUninstall("Name2");
      assertEquals(ControllerState.INSTALLED, context1.getState());
      assertEquals(ControllerState.ERROR, context2.getState());
     
      factory1 = (GenericBeanFactory) context1.getTarget();
      bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());

      context2 = assertInstall(1, "Name2");
     
      factory1 = (GenericBeanFactory) context1.getTarget();
      bean1 = (SimpleBean) factory1.createBean();
      assertEquals("String1", bean1.getString());
     
      factory2 = (GenericBeanFactory) context2.getTarget();
      bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
   }
View Full Code Here

      genericBeanFactoryDependencyCorrectOrder();

      assertInstall(0, "simple");
      ControllerContext context2 = assertInstall(1, "aspect");

      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean();
      assertEquals("factory", bean.getString());
      assertEquals("String1", bean.getSimpleBean().getString());
   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.metadata.plugins.factory.GenericBeanFactory

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.