geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r611235 - /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
Date Fri, 11 Jan 2008 17:09:36 GMT
Author: gawor
Date: Fri Jan 11 09:09:35 2008
New Revision: 611235

URL: http://svn.apache.org/viewvc?rev=611235&view=rev
Log:
perform more precise query to get the right ServiceInfo object. this should fix the tomcat
testsuites error with deploying app client modules

Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java?rev=611235&r1=611234&r2=611235&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
Fri Jan 11 09:09:35 2008
@@ -29,7 +29,6 @@
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
 
 //
 // FIXME: It should be possible to query state with-out any Geronimo classes,
@@ -40,7 +39,7 @@
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
-
+import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -108,7 +107,7 @@
         return mbeanConnection;
     }
 
-        public boolean isFullyStarted() {
+    public boolean isFullyStarted() {
         boolean fullyStarted = true;
 
         try {
@@ -156,15 +155,15 @@
         String home = null;
 
         try {
-            ObjectName systemInfoQuery = new ObjectName("*:name=ServerInfo,j2eeType=GBean,*");
-
-            getConnection();
-
-            Set set = mbeanConnection.queryNames(systemInfoQuery, null);
-
-            if (set.size() > 0) {
-                ObjectName found = (ObjectName)set.iterator().next();
-                home = (String)mbeanConnection.getAttribute(found, "currentBaseDirectory");
+            AbstractNameQuery query = new AbstractNameQuery(ServerInfo.class.getName());
+            Set result = listGBeans(query);
+            Iterator iter = result.iterator();
+            while (iter.hasNext()) {
+                AbstractName name = (AbstractName)iter.next();
+                home  = (String)getAttribute(name, "currentBaseDirectory");
+                if (home != null) {
+                    break;
+                }
             }
         }
         catch (IOException e) {



Mime
View raw message