[jboss-cvs] JBossAS SVN: r87315 - in branches/Branch_5_x: system/src/main/org/jboss/system/server/profileservice and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 14 23:59:21 EDT 2009


Author: scott.stark at jboss.org
Date: 2009-04-14 23:59:21 -0400 (Tue, 14 Apr 2009)
New Revision: 87315

Modified:
   branches/Branch_5_x/system/src/main/org/jboss/system/server/ServerInfo.java
   branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java
Log:
JBAS-6786, use unique component types for server components

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/ServerInfo.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/ServerInfo.java	2009-04-15 00:30:22 UTC (rev 87314)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/ServerInfo.java	2009-04-15 03:59:21 UTC (rev 87315)
@@ -66,7 +66,7 @@
    name="jboss.system:type=ServerInfo",
    isRuntime=true,
    description="provides a view of system information for the JBoss server in which it is deployed",
-   componentType=@ManagementComponent(type="MCBean", subtype="*")
+   componentType=@ManagementComponent(type="MCBean", subtype="ServerInfo")
 )
 public class ServerInfo
    implements ServerInfoMBean, MBeanRegistration

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2009-04-15 00:30:22 UTC (rev 87314)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2009-04-15 03:59:21 UTC (rev 87315)
@@ -39,7 +39,6 @@
 import org.jboss.bootstrap.spi.Server;
 import org.jboss.bootstrap.spi.ServerConfig;
 import org.jboss.bootstrap.spi.microcontainer.MCServer;
-import org.jboss.config.spi.Configuration;
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployers.client.spi.IncompleteDeploymentException;
@@ -501,8 +500,7 @@
          // Add other Server managed objects
          if(firstDeployment != null)
          {
-            ComponentType type = KnownComponentTypes.MCBean.Any.getType();
-            // MCServer
+            ComponentType type = new ComponentType("MCBean", "MCServer");
             ManagedObject serverMO = mof.initManagedObject(mcserver, null);
             if (serverMO.getOperations() != null && serverMO.getOperations().size() == 0)
             {
@@ -528,6 +526,7 @@
                log.error("Failed to create BeanInfo for: "+serverComp, t);
             }
             // ServerConfig
+            type = new ComponentType("MCBean", "ServerConfig");
             ServerConfig config = mcserver.getConfig();
             ManagedObject mo = mof.initManagedObject(config, null);
             ManagedComponentImpl configComp = new ManagedComponentImpl(type, firstDeployment, mo);

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java	2009-04-15 00:30:22 UTC (rev 87314)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java	2009-04-15 03:59:21 UTC (rev 87315)
@@ -73,7 +73,7 @@
       throws Exception
    {
       ManagementView mgtView = getManagementView();
-      ComponentType type = KnownComponentTypes.MCBean.Any.getType();
+      ComponentType type = new ComponentType("MCBean", "ServerInfo");
       getLog().debug("MCBeans: "+mgtView.getComponentsForType(type));
       ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerInfo", type);
       assertNotNull(mc);
@@ -128,7 +128,7 @@
       throws Exception
    {
       ManagementView mgtView = getManagementView();
-      ComponentType type = KnownComponentTypes.MCBean.Any.getType();
+      ComponentType type = new ComponentType("MCBean", "MCServer");
       ManagedComponent mc = mgtView.getComponent("jboss.system:type=MCServer", type);
       assertNotNull(mc);
 
@@ -219,7 +219,7 @@
       throws Exception
    {
       ManagementView mgtView = getManagementView();
-      ComponentType type = KnownComponentTypes.MCBean.Any.getType();
+      ComponentType type = new ComponentType("MCBean", "ServerConfig");
       ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
       assertNotNull(mc);
       Map<String, ManagedProperty> props = mc.getProperties();
@@ -292,17 +292,17 @@
       InetAddress address = InetAddress.getByName(getServerHost());
       // Load the 
       ManagementView mgtView = getManagementView();
-      ComponentType type = new ComponentType("MBean", "Web");
-      String name = "jboss.web:host="+address.getHostAddress()+",type=Host";
+      ComponentType type = new ComponentType("MBean", "Web:Host");
+      String name = "jboss.web:host=localhost,type=Host";
       ManagedComponent mc = mgtView.getComponent(name, type);
       assertNotNull(name, mc);
       Map<String, ManagedProperty> props = mc.getProperties();
       for(ManagedProperty mp : props.values())
          log.info(mp.getName()+", "+mp.getValue());
       
-      ManagedProperty currentThreadCount = mc.getProperty("aliases");
-      assertNotNull(currentThreadCount);
-      assertEquals(mc.getRunState(), RunState.RUNNING);
+      ManagedProperty aliases = mc.getProperty("aliases");
+      assertNotNull(aliases);
+      assertEquals(RunState.RUNNING, mc.getRunState());
    }
    
    /**




More information about the jboss-cvs-commits mailing list