Package org.jboss.deployers.spi.management

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


    * @throws Exception
    */
   public void testDefaultDSOps()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Set<ManagedOperation> ops = hsqldb.getOperations();
      log.info("DefaultDS ops: "+ops);
      assertNotNull("Set<ManagedOperation>", ops);
      assertTrue("Set<ManagedOperation> > 0", ops.size() > 0);
      ManagedOperation listFormattedSubPoolStatistics = null;
View Full Code Here


    * @throws Exception
    */
   public void testJTAComponentCount()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "JTA");
      Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
      int count = comps.size();
      assertEquals("There is 1 MCBean:JTA ManagedComponent", 1, 1);
      ManagedComponent comp = comps.iterator().next();
      Map<String, ManagedProperty> props = comp.getProperties();
      for(ManagedProperty prop : props.values())
View Full Code Here

                                    Map<String, MetaValue> propValues,
                                    String deploymentName,
                                    ComponentType componentType, String componentName)
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      DeploymentTemplateInfo dsInfo = mgtView.getTemplate(templateName);
      assertNotNull("template " + templateName + " found", dsInfo);
      Map<String, ManagedProperty> props = dsInfo.getProperties();

      for(String propName : propValues.keySet())
      {
         ManagedProperty prop = props.get(propName);
         // If the property does not exist on the template we don't set it
         if(prop == null)
            continue;
        
         log.debug("template property before: "+prop.getName()+","+prop.getValue());
         assertNotNull("property " + propName + " found in template " + templateName, prop);
         prop.setValue(propValues.get(propName));
         log.debug("template property after: "+prop.getName()+","+prop.getValue());
      }
     
      // Assert map composite
      if(dsInfo.getProperties().get("config-property") != null)
         assertTrue(dsInfo.getProperties().get("config-property").getMetaType() instanceof MapCompositeMetaType);
     
      mgtView.applyTemplate(deploymentName, dsInfo);

      // reload the view
      activeView = null;
      mgtView = getManagementView();
      ManagedComponent dsMC = getManagedComponent(mgtView, componentType, componentName);
View Full Code Here

    * @throws Exception
    */
   public void testServerInfo()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      mgtView.reload();
      ComponentType type = new ComponentType("MCBean", "ServerInfo");
      getLog().debug("MCBeans: "+mgtView.getComponentsForType(type));
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerInfo", type);
      assertNotNull(mc);
      // Serach by alias for the jmx name
      AliasMatcher matcher = new AliasMatcher();
      Set<ManagedComponent> mcs = mgtView.getMatchingComponents("jboss.system:type=ServerInfo", type, matcher);
      log.debug("jboss.system:type=ServerInfo components: "+mcs);
      assertEquals("Found one MC for alias", 1, mcs.size());
      Map<String, ManagedProperty> props = mc.getProperties();
      getLog().info(props);
      // , activeThreadGroupCount, hostAddress, OSVersion, javaVMName, totalMemory, activeThreadCount, alias, hostName, javaVMVendor, javaVendor, javaVMVersion, OSName, javaVersion
View Full Code Here

    * @throws Exception
    */
   public void testMCServer()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "MCServer");
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=MCServer", type);
      assertNotNull(mc);

      // Validate properties, [buildOS, buildID, config, buildNumber, startDate, buildDate, versionName, buildJVM, versionNumber, version]
      Map<String, ManagedProperty> props = mc.getProperties();
      getLog().info(props);
View Full Code Here

    * @throws Exception
    */
   public void testTransactionManager()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "JTA");
      ManagedComponent mc = mgtView.getComponent("TransactionStatistics", type);
      assertNotNull(mc);
      Map<String, ManagedProperty> props = mc.getProperties();
      getLog().info(props);

      ManagedProperty transactionCount = props.get("numberOfTransactions");
View Full Code Here

    * @throws Exception
    */
   public void testServerConfig()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "ServerConfig");
      ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
      assertNotNull(mc);
      Map<String, ManagedProperty> props = mc.getProperties();
      getLog().info(props);
   }
View Full Code Here

      getLog().info(props);
   }

   public void testMBeanFactory() throws Exception
   {
      ManagementView mgtView = getManagementView();
      Collection<ManagedComponent> components = mgtView.getComponentsForType(new ComponentType("MBean", "WebApplicationManager"));
      assertNotNull(components);
     
   }
View Full Code Here

                                      String deploymentName,
                                      ComponentType componentType, String componentName,
                                      boolean processChanges)
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      DeploymentTemplateInfo info = mgtView.getTemplate(templateName);
      assertNotNull("template " + templateName + " found", info);
      Map<String, ManagedProperty> props = info.getProperties();
      for(String propName : propValues.keySet())
      {
         ManagedProperty prop = props.get(propName);
         assertTrue(prop.getName(), prop.hasViewUse(ViewUse.CONFIGURATION));
         log.debug("createComponentTest("+propName+") before: "+prop.getValue());
         assertNotNull("property " + propName + " found in template " + templateName, prop);
         prop.setValue(propValues.get(propName));
         log.debug("createComponentTest("+propName+") after: "+prop.getValue());
      }
      for(String propName : removedPropNames)
      {
         ManagedProperty prop = props.get(propName);
         prop.setRemoved(true);
         log.debug("removed property: "+propName);
      }
     
      mgtView.applyTemplate(deploymentName, info);
      if(processChanges)
      {
         mgtView.process();
  
         // reload the view
         activeView = null;
         mgtView = getManagementView();
         ManagedComponent dsMC = getManagedComponent(mgtView, componentType, componentName);
View Full Code Here

    *
    * @exception thrown if there are no matching components
    */
   public void testSecurityMCBeans() throws Exception
   {
      ManagementView managementView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      Set<ManagedComponent> mcs = managementView.getComponentsForType(type);
      assertTrue("There are MCBean,Security components", mcs.size() > 0);
      super.getLog().debug("MCBeans: " + mcs);
   }
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.