Package org.jboss.kernel.spi.dependency

Examples of org.jboss.kernel.spi.dependency.KernelController.install()


   public void testInstalls() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("pb1", TestBean.class.getName()));
      controller.install(new AbstractBeanMetaData("pb2", TestBean.class.getName()));
      controller.install(new AbstractBeanMetaData("pb3", TestBean.class.getName()));
      CallbacksTester tester = new CallbacksTester();

      testFields(tester, new CallbacksTesterVerifier(), BeanAccessMode.FIELDS);
      assertTesterAfterInstall(tester);
View Full Code Here


         bean.setMode(ControllerMode.MANUAL);
         DemandMetaData demand = new AbstractDemandMetaData("foobar");
         ((AbstractDemandMetaData)demand).setWhenRequired(ControllerState.INSTANTIATED);
         bean.setDemands(Collections.singleton(demand));

         KernelControllerContext beanContext = controller.install(bean);
         controller.change(beanContext, ControllerState.NOT_INSTALLED);

         ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName());
         lazy.setInterfaces(Collections.singleton(IRare.class.getName()));
         KernelControllerContext lazyContext = controller.install(lazy);
View Full Code Here

         KernelControllerContext beanContext = controller.install(bean);
         controller.change(beanContext, ControllerState.NOT_INSTALLED);

         ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName());
         lazy.setInterfaces(Collections.singleton(IRare.class.getName()));
         KernelControllerContext lazyContext = controller.install(lazy);

         assertNotNull(lazyContext);
         assertEquals(ControllerState.INSTALLED, lazyContext.getState());

         controller.change(beanContext, ControllerState.DESCRIBED);
View Full Code Here

         catch(Throwable t)
         {
            assertInstanceOf(t, IllegalArgumentException.class);
         }

         controller.install(new AbstractBeanMetaData("foobar", Object.class.getName()));
         controller.change(beanContext, ControllerState.INSTALLED);

         assertEquals(0, lazyRare.getHits());
         lazyRare.setHits(10);
         assertEquals(5, lazyRare.checkHits(15));
View Full Code Here

      KernelController controller = kernel.getController();
      try
      {
         AbstractBeanMetaData bean = new AbstractBeanMetaData("bean", RareBean.class.getName());
         bean.setMode(ControllerMode.ON_DEMAND);
         KernelControllerContext beanContext = controller.install(bean);

         ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName());
         lazy.setInterfaces(Collections.singleton(IRare.class.getName()));
         KernelControllerContext lazyContext = controller.install(lazy);
         assertNotNull(lazyContext);
View Full Code Here

         bean.setMode(ControllerMode.ON_DEMAND);
         KernelControllerContext beanContext = controller.install(bean);

         ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName());
         lazy.setInterfaces(Collections.singleton(IRare.class.getName()));
         KernelControllerContext lazyContext = controller.install(lazy);
         assertNotNull(lazyContext);
         assertEquals(ControllerState.INSTALLED, lazyContext.getState());

         IRare lazyRare = (IRare)lazyContext.getTarget();
         assertNotNull(lazyRare);
View Full Code Here

      bkbv.setDisabled(false);

      try
      {
         MockBeanValidatorBridge bridge = new MockBeanValidatorBridge();
         controller.install(new AbstractBeanMetaData("bvb", MockBeanValidatorBridge.class.getName()), bridge);

         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("tester", BVBTester.class.getName());
         builder.addPropertyMetaData("something", 123);
         builder.addInstall("invokeSomething", Object.class.getName(), "123");
         controller.install(builder.getBeanMetaData());
View Full Code Here

         controller.install(new AbstractBeanMetaData("bvb", MockBeanValidatorBridge.class.getName()), bridge);

         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("tester", BVBTester.class.getName());
         builder.addPropertyMetaData("something", 123);
         builder.addInstall("invokeSomething", Object.class.getName(), "123");
         controller.install(builder.getBeanMetaData());

         assertNotNull(bridge.getJoinpoint());
         assertInstanceOf(bridge.getTarget(), BVBTester.class);
         assertEquals("something", bridge.getProperty());
         assertEquals("invokeSomething", bridge.getMethod());
View Full Code Here

   public void testAfterInstantiationBeanInfo() throws Throwable
   {
      KernelController controller = getController();
      // other
      KernelControllerContext occ = controller.install(new AbstractBeanMetaData("other", OtherVerifier.class.getName()));
      assertNotNull(occ);
      Object tcc = occ.getTarget();
      assertNotNull(tcc);

      // tester
View Full Code Here

      builder.setName("tester");
      builder.setAccessMode(BeanAccessMode.ALL);
      builder.setFactoryClass(AfterInstantiateTester.class.getName());
      builder.setFactoryMethod("getTester");

      KernelControllerContext kcc = controller.install(builder.getBeanMetaData());
      try
      {
         assertNotNull(kcc);
         BeanMetaData beanMetaData = kcc.getBeanMetaData();
         // test aliases
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.