You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/01/10 16:07:05 UTC

svn commit: r1229582 - /axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java

Author: veithen
Date: Tue Jan 10 15:07:05 2012
New Revision: 1229582

URL: http://svn.apache.org/viewvc?rev=1229582&view=rev
Log:
Allow to start the test server with remote JMX enabled.

Modified:
    axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java

Modified: axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java?rev=1229582&r1=1229581&r2=1229582&view=diff
==============================================================================
--- axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java (original)
+++ axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java Tue Jan 10 15:07:05 2012
@@ -111,6 +111,22 @@ public class StartServerMojo extends Abs
      */
     private boolean debug;
     
+    /**
+     * The arguments to pass to the server JVM when JMX is enabled.
+     * 
+     * @parameter default-value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
+     */
+    private String jmxArgs;
+    
+    /**
+     * Indicates whether the server should be started with remote JMX enabled. This flag can only be
+     * set from the command line.
+     * 
+     * @parameter expression="${axis.server.jmx}" default-value="false"
+     * @readonly
+     */
+    private boolean jmx;
+    
     public void execute() throws MojoExecutionException, MojoFailureException {
         Log log = getLog();
         
@@ -163,7 +179,10 @@ public class StartServerMojo extends Abs
         // Compute JVM arguments
         List vmArgs = new ArrayList();
         if (debug) {
-            vmArgs.addAll(Arrays.asList(debugArgs.split(" ")));
+            processVMArgs(vmArgs, debugArgs);
+        }
+        if (jmx) {
+            processVMArgs(vmArgs, jmxArgs);
         }
         if (log.isDebugEnabled()) {
             log.debug("Additional VM args: " + vmArgs);
@@ -206,4 +225,8 @@ public class StartServerMojo extends Abs
             }
         }
     }
+    
+    private static void processVMArgs(List vmArgs, String args) {
+        vmArgs.addAll(Arrays.asList(args.split(" ")));
+    }
 }