Package org.jboss.deployers.spi.management

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


   {
      String deploymentName = "profileservice-datasource.ear";
      try
      {
         deployPackage(deploymentName);
         ManagementView mgtView = getManagementView();
         ManagedDeployment deployment = mgtView.getDeployment(deploymentName);
         assertNotNull("Null managed deployment", deployment);
        
         assertNotNull(deployment.getChildren());
         assertFalse(deployment.getChildren().isEmpty());

         // Update first DataSource
         // get test-ds.xml child
         ManagedDeployment md =  null;
         for(ManagedDeployment d : deployment.getChildren())
         {
            if(d.getName().endsWith("test-ds.xml"))
            {
               md = d;
               break;
            }
         }
         assertNotNull(md);
        
         ManagedComponent mc = md.getComponent("ProfileServiceNestedTestDS");
         assertNotNull("Null managed component", mc);
        
         // This should work too
         ManagedComponent comp = getManagedComponent(mgtView, "ProfileServiceNestedTestDS");
         assertNotNull(comp);
        
         ManagedProperty p = mc.getProperty("jndi-name");
         p.setValue(SimpleValueSupport.wrap("ChangedNestedDsJNDIName"));
        
         // Update prepared-statement-cache-size
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         // assert
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(32), property.getValue());
         // change value
         property.setValue(SimpleValueSupport.wrap(34));
        
         // updateComponent and process()
         mgtView.updateComponent(mc);
        
         //
         // Update 2nd DataSource
         md = null;
         for(ManagedDeployment d : deployment.getChildren())
         {
            if(d.getName().endsWith("test-second-ds.xml"))
            {
               md = d;
               break;
            }
         }
         assertNotNull(md);
         mc = md.getComponent("OtherNestedTestDS");
        
         // prepared-statement-cache-size
         property = mc.getProperty("prepared-statement-cache-size");
         // assert
         assertEquals(property.getValue(), SimpleValueSupport.wrap(12));
         // change
         property.setValue(SimpleValueSupport.wrap(33));
        
         // max-pool-size
         property = mc.getProperty("max-pool-size");
         // assert
         assertEquals(property.getValue(), SimpleValueSupport.wrap(22));
         // change
         property.setValue(SimpleValueSupport.wrap(19));
        
         // updateComponent and process()
         mgtView.updateComponent(mc);
      
         // See if the changes are reflected in the managedView after a reload
         mgtView = getManagementView();

         ManagedComponent comp2 = getManagedComponent(mgtView, "ChangedNestedDsJNDIName");
View Full Code Here


   }

   public void testMCBeansDeploymentType()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      Set<String> names = mgtView.getDeploymentNamesForType(KnownDeploymentTypes.MCBeans.getType());
      log.info("beans names: "+names);
      assertTrue("names.size > 0 ", names.size() > 0);
      // To check for a jbossweb.deployer
      boolean sawJbosswebDeployer = false;
      // To check for a profileservice-beans.xml
View Full Code Here

    * @throws Exception
    */  
   public void testRemoveComponent () throws Exception
   {
     String componentName = "defaultDS";
     ManagementView mgtView = getManagementView();
    
     ComponentType type = new ComponentType("DataSource", "LocalTx");
     Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
    
     // maybe a mgtView.getComponentByNameAndType(type, componentName) would be helpful
     // i'm assuming componentName and type will be unique in a given profile.
    
     if (comps != null)
View Full Code Here

    */
   public void testListDataSourceComponents() throws Exception
   {
      log.info("+++ testListDataSourceComponents");

      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent ds = getManagedComponent(mgtView, type, "DefaultDS");
      assertNotNull("hsqldb-ds.xml ManagedComponent", ds);
      Map<String,ManagedProperty> props = ds.getProperties();
      log.info("hsqldb-ds.props: "+props);
View Full Code Here

    */
   public void testUpdateDefaultDS()
      throws Exception
   {
      log.info("+++ testUpdateDefaultDS");
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Map<String,ManagedProperty> props = hsqldb.getProperties();
      log.info("hsqldb.props: "+props);
      // Update properties
      ManagedProperty minSize = props.get("min-pool-size");
      minSize.setValue(SimpleValueSupport.wrap(new Integer(13)));
      ManagedProperty maxSize = props.get("max-pool-size");
      maxSize.setValue(SimpleValueSupport.wrap(new Integer(53)));

      mgtView.updateComponent(hsqldb);

      // TODO: Query the mbeans to validate the change
      // TODO: Query the profile service repository for the overriden data
   }
View Full Code Here

    * @throws Exception
    */
   public void testLocalTxDataSourceTemplatePropertiesAreMetaValues()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("LocalTxDataSourceTemplate");
      Map<String,ManagedProperty> props = dsInfo.getProperties();
      validatePropertyMetaValues(props);
   }
View Full Code Here

    * @throws Exception
    */
   public void testXADataSourceTemplateTemplatePropertiesAreMetaValues()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("XADataSourceTemplate");
      Map<String,ManagedProperty> props = dsInfo.getProperties();
      validatePropertyMetaValues(props);
   }
View Full Code Here

    * @throws Exception
    */
   public void testDefaultDSComponentCount()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
      int count = 0;
      for (ManagedComponent comp : comps)
      {
        String cname = comp.getName();
        if( cname.endsWith("DefaultDS") )
View Full Code Here

    * @throws Exception
    */
   public void testDefaultDSPropertiesAreMetaValues()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Map<String,ManagedProperty> props = hsqldb.getProperties();
      validatePropertyMetaValues(props);

      // Validate the config-property
      ManagedProperty configProperty = hsqldb.getProperty("config-property");
View Full Code Here

    * @throws Exception
    */
   public void testDefaultDSStats()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Map<String,ManagedProperty> props = hsqldb.getProperties();
      ArrayList<ManagedProperty> stats = new ArrayList<ManagedProperty>();
      for(ManagedProperty prop : props.values())
      {
         if(prop.hasViewUse(ViewUse.STATISTIC))
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.