Package org.jboss.deployers.spi.management

Examples of org.jboss.deployers.spi.management.ManagementView


      assertEquals("Unexpected number of properties", hasState ? 5 : 4, properties.size());
   }

   private ManagedComponent getServiceBindingManagerManagedComponent() throws Exception
   {
      ManagementView managementView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "ServiceBindingManager");
      ManagedComponent component = managementView.getComponent("ServiceBindingManager", type);
      assertNotNull(component);
      return component;
   }
View Full Code Here


   }
  
   public void test() throws Exception
   {
     
      ManagementView managementView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent component = managementView.getComponent("JmsXA", type);
      assertNotNull(component);
  
      ManagedProperty property = component.getProperty("max-pool-size");
      assertNotNull(property);
     
      property.setValue(SimpleValueSupport.wrap(21));
     
      // TODO test more properties.
     
      managementView.updateComponent(component);
   }
View Full Code Here

   {
     
      String repositoryNames[] = deployPackage("profileservice-remove-ds.xml");
      assertNotNull(repositoryNames);

      ManagementView mgtView = getManagementView();
     
      //
      ComponentType locaDSType = new ComponentType("DataSource", "LocalTx");
      ManagedComponent test1 = mgtView.getComponent("ProfileServiceTestDataSource1", locaDSType);
      assertNotNull(test1);
      ManagedComponent remove = mgtView.getComponent("ProfileServiceTestRemoveDataSource", locaDSType);
      assertNotNull(remove);
      ManagedComponent test2 = mgtView.getComponent("ProfileServiceTestDataSource2", locaDSType);
      assertNotNull(test2)
      // Remove
      mgtView.removeComponent(remove);
     
      // Redeploy
      DeploymentProgress progress = getDeploymentManager().redeploy(test1.getDeployment().getName());
      progress.run();
     
      mgtView = getManagementView();
      remove = mgtView.getComponent("ProfileServiceTestRemoveDataSource", locaDSType);
      assertNull(remove);     
   }
View Full Code Here

   protected ManagementView getManagementView() throws Exception
   {
      InitialContext ctx = getInitialContext();
      ProfileService ps = (ProfileService)ctx.lookup("ProfileService");
      ManagementView activeView = ps.getViewManager();
      activeView.load();
      return activeView;
   }
View Full Code Here

      return activeView;
   }

   protected ManagedDeployment getDeploymentUnit(String deployment) throws Exception
   {
      ManagementView mv = getManagementView();
      return mv.getDeployment(deployment);
   }
View Full Code Here

      assertNull("Should not be deployed " + result, result);
   }

   protected boolean isDeployed(String deployment) throws Exception
   {
      ManagementView mv = getManagementView();
      ManagedDeployment md = mv.getDeployment(deployment);
      return (md != null);
   }
View Full Code Here

    *
    * @throws Exception
    */
   public void testHotDeploymentBeans() throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "ServerConfig");
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
      assertNotNull(mc);
      ManagedProperty homeDirProperty = mc.getProperty("serverHomeDir");
      assertNotNull("serverHomeDir property exists", homeDirProperty);
      String homeDir = (String) ((SimpleValue) homeDirProperty.getValue()).getValue();
      assertNotNull(homeDir);
     
      // Manually copy the deployment
      File deploy = new File(homeDir, "deploy/");
      File hotDeployment = copyFile(deploy, HD_DEPLOYMENT);
      File failedDeployment = copyFile(deploy, FAILING_DEPLOYMENT);
     
      // Wait for HDScanner
      Thread.sleep(8000);
     
      // Reload mgtView
      mgtView = getManagementView();
      try
      {
         ManagedDeployment md = mgtView.getDeployment(HD_DEPLOYMENT);
         assertNotNull("hd-beans not deployed", md);
         assertEquals("deployment started", DeploymentState.STARTED, md.getDeploymentState());
        
         // HDScanner will not undeploy failed deployment unlike the deployMgr
         // the state should represent this as well
         md = mgtView.getDeployment(FAILING_DEPLOYMENT);
         assertNotNull("failed-beans", md);
         assertEquals("deployment failed", DeploymentState.FAILED, md.getDeploymentState());
      }
      finally
      {
View Full Code Here

   protected ManagementView getManagementView()
      throws Exception
   {
      InitialContext ctx = getInitialContext();
      ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
      ManagementView activeView = ps.getViewManager();
      activeView.load();
      return activeView;
   }
View Full Code Here

         DeploymentProgress remove = deployMgr.remove(names);
         remove.run();
         assertComplete(remove);

         String name = remove.getDeploymentID().getNames()[0];
         ManagementView mgtView = getManagementView();
         try
         {
            mgtView.getDeployment(name);
            fail("Did not see NoSuchDeploymentException");
         }
         catch(NoSuchDeploymentException ok)
         {
            //
View Full Code Here

   }

   void assertDeploymentState(DeploymentID DtID, DeploymentState state) throws Exception
   {
      String name = DtID.getNames()[0];
      ManagementView mgtView = getManagementView();
      ManagedDeployment md = mgtView.getDeployment(name);
      assertNotNull(name, md);
      assertEquals("deployment: " + name, state, md.getDeploymentState());
      log.debug(md.getSimpleName() + " " + md.getTypes());
   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.management.ManagementView

Copyright © 2018 www.massapicom. 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.