Package org.jboss.kernel.spi.dependency

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


            if (ControllerState.INSTALLED.equals(context.getState()) == false)
            {
               ControllerMode mode = context.getMode();
               if (ControllerMode.ON_DEMAND.equals(mode) || ControllerMode.MANUAL.equals(mode))
               {
                  controller.change(context, ControllerState.INSTALLED);
               }
            }

            if (ControllerState.INSTALLED.equals(context.getState()) == false)
               throw new IllegalArgumentException("Bean " + bean + " cannot be fully installed: " + context);
View Full Code Here


         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 lazyContext = controller.install(lazy);

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

         controller.change(beanContext, ControllerState.DESCRIBED);
         controller.change(lazyContext, ControllerState.INSTALLED);

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

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

         controller.change(beanContext, ControllerState.DESCRIBED);
         controller.change(lazyContext, ControllerState.INSTALLED);

         IRare lazyRare = (IRare)lazyContext.getTarget();
         assertNotNull(lazyRare);

         try
View Full Code Here

         {
            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

      AbstractPropertyMetaData property = new AbstractPropertyMetaData("something", builder.createMap(null, String.class.getName(), String.class.getName()));
      property.setPropertyType(Map.class.getName());
      abmd.addProperty(property);

      KernelControllerContext context = controller.install(builder.getBeanMetaData());
      controller.change(context, ControllerState.INSTANTIATED);
      assertEquals(ControllerState.INSTANTIATED, context.getState());
      assertFalse(describe.error);
   }

   // -----------------------
View Full Code Here

         contexts.add(install("parent", "main", null, -1));
         contexts.add(install("local", "main", "core", -1));
         contexts.add(install("top", null, null, -1));

         // here we need a little push - since by default we only do parent hierarchy resolution
         controller.change(context, ControllerState.INSTALLED);

         assertEquals(ControllerState.INSTALLED, context.getState());
         doTestAfterInstall(context.getTarget());
      }
      finally
View Full Code Here

    */
   public <T> T lookup(String name, Class<T> expectedType) throws Throwable
   {
      KernelController controller = getKernel().getController();
      ControllerContext context = controller.getContext(name, null);
      controller.change(context, ControllerState.INSTALLED);
      if (context.getError() != null)
         throw context.getError();

      if (context.getState() != ControllerState.INSTALLED)
      {
View Full Code Here

                  String beanClassName = target.getClass().getName();
                  AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData(name, beanClassName);
                  KernelControllerContext context = controller.install(beanMetaData, target);
                  objects.add(name);
                  controller.change(context, ControllerState.INSTALLED);
               }
               catch (Throwable t)
               {
                  if (errors == null)
                     errors = new ArrayList<Throwable>();
View Full Code Here

    */
   public <T> T lookup(String name, Class<T> expectedType) throws Throwable
   {
      KernelController controller = getController();
      ControllerContext context = controller.getContext(name, null);
      controller.change(context, ControllerState.INSTALLED);
      if(context.getError() != null)
         throw context.getError();
     
      if(context.getState() != ControllerState.INSTALLED) {
         System.err.println(context.getDependencyInfo().getUnresolvedDependencies(null));
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.