Examples of ControllerContext


Examples of org.jboss.dependency.spi.ControllerContext

         //Check that the flat deployment bean has been started
         FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(earDU));
         assertNotNull(flatDeployment);

         //Check that the simple bean installer has been created
         ControllerContext ctx = getControllerContext(installerName,  null);
         assertNotNull(ctx);
         //Check the simple bean itself has not been created
         assertNoControllerContext("SimpleBean", null);
      }
      finally
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

      this.delegateICF = delegateICF;
   }

   public Object locateBean(String beanName)
   {
      ControllerContext context = getController().getInstalledContext(beanName);
      if (context == null)
      {
         return null;
      }
      return context.getTarget();
   }
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      try
      {
         DeploymentUnit du = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
         ControllerContext context = du.getAttachment(ControllerContext.class);
         assertNotNull(context);
         assertEquals(ControllerState.INSTALLED, context.getState());

         // There should be no WB bootstrap bean
         assertNoBean(DeployersUtils.getBootstrapBeanName(du), null);
      }
      finally
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

      super(name);
   }

   public void testConfigureMCFromJMX() throws Throwable
   {
      ControllerContext mbeanContext = getControllerContext("jboss.test:type=test");
      assertNotNull(mbeanContext);
      Object mbean = mbeanContext.getTarget();
      assertNotNull(mbean);
      assertInstanceOf(Simple.class, mbean);
      Simple simple = (Simple)mbean;
      String string = simple.getAttribute1();
      assertEquals("someattrib", string);

      ControllerContext beanContext = getControllerContext("Test");
      assertNotNull(beanContext);
      Object bean = beanContext.getTarget();
      assertNotNull(bean);
      assertInstanceOf(SimpleStringBean.class, bean);

      SimpleStringBean simpleBean = (SimpleStringBean) bean;
      assertEquals(string, simpleBean.getString1());
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

   {
      try
      {
         if (org.jboss.kernel.spi.registry.KernelRegistry.KERNEL_REGISTRY_REGISTERED.equals(event.getType()))
         {
            ControllerContext context = controller.getContext(event.getContext(), null);
            addControllerContext(context);
         }
      }
      catch (Throwable ignored)
      {
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

    *
    * @throws Throwable
    */
   public void checkInject() throws Throwable
   {
      ControllerContext mbeanContext = getControllerContext("jboss.test:type=test");
      assertNotNull(mbeanContext);
      Object mbean = mbeanContext.getTarget();
      assertNotNull(mbean);

      ControllerContext beanContext = getControllerContext("Test");
      assertNotNull(beanContext);
      Object bean = beanContext.getTarget();
      assertNotNull(bean);
      assertTrue(bean instanceof SimpleBean);
     
      SimpleBean simpleBean = (SimpleBean) bean;
     
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

    *
    * @throws Throwable
    */
   public void checkInject() throws Throwable
   {
      ControllerContext mbeanContext = getControllerContext("jboss.test:type=test");
      assertNotNull(mbeanContext);
      Object mbean = mbeanContext.getTarget();
      assertNotNull(mbean);
      assertTrue(mbean instanceof SimpleMBean);

      ControllerContext beanContext = getControllerContext("Test");
      assertNotNull(beanContext);
      Object bean = beanContext.getTarget();
      assertNotNull(bean);
      assertTrue(bean instanceof SimpleBean);
     
      SimpleMBean simpleMBean = (SimpleMBean) mbean;
     
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

    */
   @SuppressWarnings("unchecked")
   public <T> T getBean(final String beanName, final Class<T> clazz)
   {
      final KernelController controller = IoCContainerProxyImpl.kernel.getController();
      final ControllerContext ctx = controller.getInstalledContext(beanName);

      return (T)ctx.getTarget();
   }
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

      super(name);
   }
  
   public void testMCDependsJMX() throws Throwable
   {
      ControllerContext mbeanContext = getControllerContext("jboss.test:type=test");
      assertNotNull(mbeanContext);
      Object mbean = mbeanContext.getTarget();
      assertNotNull(mbean);
      Simple simple = assertInstanceOf(Simple.class, mbean);

      ControllerContext beanContext = getControllerContext("Test");
      assertNotNull(beanContext);
      Object bean = beanContext.getTarget();
      assertNotNull(bean);
      SimpleBean simpleBean = assertInstanceOf(SimpleBean.class, bean);
     
      assertEquals(1, simple.createOrder);
      assertEquals(2, simple.startOrder);
View Full Code Here

Examples of org.jboss.dependency.spi.ControllerContext

    * @return the bean
    * @throws IllegalStateException when the bean does not exist at that state
    */
   protected Object getBean(final Object name, final ControllerState state)
   {
      ControllerContext context = getControllerContext(name, state);
      return context.getTarget();
   }
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.