Package org.jboss.kernel.spi.dependency

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


      KernelController controller = kernel.getController();
      try
      {
         BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
         builder.addAnnotation("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")");
         controller.install(builder.getBeanMetaData());
         ControllerContext cc = controller.getInstalledContext("bean");
         assertNotNull(cc);
         MetaData metaData = cc.getScopeInfo().getMetaData();
         assertNotNull(metaData);
         assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
View Full Code Here


         assertNotNull(metaData);
         assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));

         builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName());
         builder.setAnnotations(Collections.singleton("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")"));
         controller.install(builder.getBeanMetaData());
         cc = controller.getInstalledContext("other");
         assertNotNull(cc);
         metaData = cc.getScopeInfo().getMetaData();
         assertNotNull(metaData);
         assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
View Full Code Here

      List<BeanMetaData> compBeans = componentsFactory.getBeans(baseName, nextID, this, visitor);
      T t = null;
      for(BeanMetaData bmd : compBeans)
      {
         String beanName = bmd.getName();
         KernelControllerContext kcc = controller.install(bmd);
         if(t == null)
            t = (T) kcc.getTarget();
         compNames.add(beanName);
      }
      GenericComponentInstance<T> instance = new GenericComponentInstance<T>(t, compNames, nextID);
View Full Code Here

   protected Object getTrimmedValue() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelController controller = kernel.getController();
      KernelControllerContext context = controller.install(new AbstractBeanMetaData("tester", TrimTester.class.getName()));
      TrimTester tester = (TrimTester)context.getTarget();
      return tester.getValue();
   }

   protected Object getPlainValue() throws Throwable
View Full Code Here

   protected Object getPlainValue() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelController controller = kernel.getController();
      KernelControllerContext context = controller.install(new AbstractBeanMetaData("tester", NoTrimTester.class.getName()));
      assertEquals(ControllerState.ERROR, context.getState());
      throw new IllegalStateException();
   }

   protected Class<? extends Exception> getExceptionClass()
View Full Code Here

   }

   public void testInjection() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("rg", RGProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("rb", RBProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName()));

      runAnnotationsOnClass(WBTester.class, BeanAccessMode.ALL);
   }
View Full Code Here

   public void testInjection() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("rg", RGProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("rb", RBProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName()));

      runAnnotationsOnClass(WBTester.class, BeanAccessMode.ALL);
   }
View Full Code Here

   public void testInjection() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("rg", RGProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("rb", RBProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName()));

      runAnnotationsOnClass(WBTester.class, BeanAccessMode.ALL);
   }

   public void testMultiple() throws Throwable
View Full Code Here

   }

   public void testMultiple() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("rgb", RGBProvider.class.getName()));

      AfterInstallVerifier<WBTester> verifier = new AfterInstallVerifier<WBTester>()
      {
         public void verifyContext(KernelControllerContext context)
View Full Code Here

   public void testMultiple() throws Throwable
   {
      KernelController controller = getController();
      controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName()));
      controller.install(new AbstractBeanMetaData("rgb", RGBProvider.class.getName()));

      AfterInstallVerifier<WBTester> verifier = new AfterInstallVerifier<WBTester>()
      {
         public void verifyContext(KernelControllerContext context)
         {
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.