Package org.jboss.kernel.spi.dependency

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


      builder.addMethodUninstallCallback("removeBootstrap");
      builder.ignoreStart(); // We invoke start manually, don't let MC do it
      try
      {
         log.debug("Installing " + this + " into MC under key: " + mcServerBindName);
         controller.install(builder.getBeanMetaData(), this);
      }
      catch (Throwable t)
      {
         throw new Exception("Error in installing " + mcServerBindName + " during startup", t);
      }
View Full Code Here


   {
      final KernelController controller = getController();
      try
      {
         BeanMetaData singleton = new AbstractBeanMetaData("singleton", Singleton.class.getName());
         controller.install(singleton);

         installFactory(controller, "prototype", Prototype.class);

         AbstractBeanMetaData injectorBean = new AbstractBeanMetaData("injector", GuiceInjectorFactory.class.getName());
         AbstractConstructorMetaData constructor = new AbstractConstructorMetaData();
View Full Code Here

         AbstractArrayMetaData array = new AbstractArrayMetaData();
         array.add(new AbstractValueMetaData(GuiceObject.ALL));
         parameters.add(new AbstractParameterMetaData(array));
         constructor.setParameters(parameters);
         injectorBean.setConstructor(constructor);
         controller.install(injectorBean);

         Key<Singleton> singletonKey = Key.get(Singleton.class, Names.named("singleton"));
         Key<Prototype> prototypeKey = Key.get(Prototype.class, Names.named("prototype"));

         ControllerContext injectorContext = controller.getInstalledContext("injector");
View Full Code Here

            }
         };
         arrayMetaData.add(new AbstractValueMetaData(module));
         constructor.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(arrayMetaData)));
         guicePlugin.setConstructor(constructor);
         controller.install(guicePlugin);

         BeanMetaData holderBean = new AbstractBeanMetaData("holder", SingletonHolder.class.getName());
         controller.install(holderBean);

         ControllerContext holderContext = controller.getInstalledContext("holder");
View Full Code Here

         constructor.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(arrayMetaData)));
         guicePlugin.setConstructor(constructor);
         controller.install(guicePlugin);

         BeanMetaData holderBean = new AbstractBeanMetaData("holder", SingletonHolder.class.getName());
         controller.install(holderBean);

         ControllerContext holderContext = controller.getInstalledContext("holder");
         assertNotNull(holderContext);
         SingletonHolder holder = (SingletonHolder)holderContext.getTarget();
         assertNotNull(holder);
View Full Code Here

   {
      KernelController controller = kernel.getController();
      log.debug("Deploying " + beanMetaData);
      try
      {
         KernelControllerContext result = controller.install(beanMetaData);
         log.debug("Deployed " + result.getName());
         return result;
      }
      catch (Exception e)
      {
View Full Code Here

   {
      String beanName = createTestBeanName();
      KernelController controller = getController();
      try
      {
         controller.install(new AbstractBeanMetaData(beanName, getClass().getName()), this);
         // we're installed
         testBeanName = beanName;
      }
      catch (Throwable t)
      {
View Full Code Here

      builder.setStop("doStop");
      builder.setDestroy("executeDestroy");
      builder.addDestroyParameter("int", 123);
      builder.addDestroyParameter(Date.class.getName(), new Date());

      KernelControllerContext context = controller.install(builder.getBeanMetaData());
      assertEquals(ControllerState.INSTALLED, context.getState());

      KernelBus bus = kernel.getBus();
      assertInstanceOf(bus, LifecycleAwareKernelBus.class);
View Full Code Here

      // bean context
      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("BeanContext", BaseContext.class.getName());
      builder.addConstructorParameter(BeanContainer.class.getName(), new BeanContainer<Object>());
      builder.addAlias(baseName + "$" + "BeanContext");
      builder.addAnnotation(sflAnn);
      result.add(controller.install(builder.getBeanMetaData()).getTarget());

      // instance interceptor
      builder = BeanMetaDataBuilder.createBuilder("InstanceInterceptor", InstanceInterceptor.class.getName());
      builder.addAlias(baseName + "$" + "InstanceInterceptor");
      builder.addAnnotation(sflAnn);
View Full Code Here

      builder = BeanMetaDataBuilder.createBuilder("InstanceInterceptor", InstanceInterceptor.class.getName());
      builder.addAlias(baseName + "$" + "InstanceInterceptor");
      builder.addAnnotation(sflAnn);
      builder.addInstallWithThis("addInterceptor", "BeanContext");
      builder.addUninstallWithThis("removeInterceptor", "BeanContext");
      result.add(controller.install(builder.getBeanMetaData()).getTarget());

      return result;
   }
}
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.