geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r936151 - in /geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo: ServerProxy.java server/RunClientMojo.java
Date Wed, 21 Apr 2010 03:43:03 GMT
Author: gawor
Date: Wed Apr 21 03:43:03 2010
New Revision: 936151

URL: http://svn.apache.org/viewvc?rev=936151&view=rev
Log:
geronimo-maven-plugin updates: 1) fix shutdown, and 2) fix app client

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

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java?rev=936151&r1=936150&r2=936151&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
Wed Apr 21 03:43:03 2010
@@ -29,6 +29,7 @@ import javax.management.remote.JMXServic
 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,
@@ -212,7 +213,14 @@ public class ServerProxy
 
     public void shutdown() {
         try {
-            invoke("shutdown");
+            Set<ObjectName> objectNameSet =
+                mbeanConnection.queryNames(new ObjectName("osgi.core:type=framework,*"),
null);
+            if (objectNameSet.isEmpty()) {
+                throw new Exception("Framework mbean not found");
+            } else if (objectNameSet.size() == 1) {
+                mbeanConnection.invoke(objectNameSet.iterator().next(), "stopBundle",
+                                          new Object[] { 0 }, new String[] { long.class.getName()
});
+            }
         }
         catch (Exception e) {
             log.warn("Unable to shutdown the server", e);

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java?rev=936151&r1=936150&r2=936151&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java
Wed Apr 21 03:43:03 2010
@@ -22,6 +22,8 @@ package org.apache.geronimo.mavenplugins
 import java.io.File;
 
 import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
 
 import org.apache.maven.plugin.MojoExecutionException;
 
@@ -99,7 +101,12 @@ public class RunClientMojo extends Repor
         log.info("Starting Geronimo client...");
 
         Java java = (Java)createTask("java");
-        java.setJar(new File(geronimoHome, "bin/client.jar"));
+        java.setClassname("org.apache.geronimo.cli.client.ClientCLI");
+        Path path = java.createClasspath();
+        File libDir = new File(geronimoHome, "lib");
+        FileSet fileSet = new FileSet();
+        fileSet.setDir(libDir);
+        path.addFileset(fileSet);
         java.setDir(geronimoHome);
         java.setFailonerror(true);
         java.setFork(true);
@@ -123,10 +130,16 @@ public class RunClientMojo extends Repor
 
         // Set the properties which we pass to the JVM from the startup script
         setSystemProperty(java, "org.apache.geronimo.home.dir", geronimoHome);
+        setSystemProperty(java, "karaf.home", geronimoHome);
+        setSystemProperty(java, "karaf.base", geronimoHome);
+        // Use relative path
         setSystemProperty(java, "java.io.tmpdir", "var/temp");
         setSystemProperty(java, "java.endorsed.dirs", prefixSystemPath("java.endorsed.dirs",
new File(geronimoHome, "lib/endorsed")));
         setSystemProperty(java, "java.ext.dirs", prefixSystemPath("java.ext.dirs", new File(geronimoHome,
"lib/ext")));
-
+        // set console properties
+        setSystemProperty(java, "karaf.startLocalConsole", "false");
+        setSystemProperty(java, "karaf.startRemoteShell", "false");
+        
         java.createArg().setValue(moduleId);
 
         for (int i=0;arg != null && i<arg.length;i++) {



Mime
View raw message