geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r567793 - /geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Date Mon, 20 Aug 2007 19:22:30 GMT
Author: jdillon
Date: Mon Aug 20 12:22:29 2007
New Revision: 567793

URL: http://svn.apache.org/viewvc?rev=567793&view=rev
Log:
Add support for -J and -D flags for javaopt and properties

Modified:
    geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy

Modified: geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=567793&r1=567792&r2=567793&view=diff
==============================================================================
--- geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
(original)
+++ geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Mon Aug 20 12:22:29 2007
@@ -51,6 +51,10 @@
 
     int timeout = -1
     
+    Map properties = [:]
+    
+    List javaFlags = []
+    
     StartServerCommand() {
         super('start-server')
     }
@@ -163,9 +167,38 @@
             javaAgent = line.getOptionValue('H')
         }
         
-        // -D
+        if (line.hasOption('D')) {
+            def values = line.getOptionValues('D')
+            
+            def addProperty = { namevalue ->
+                def name, value
+                int i = namevalue.indexOf('=')
+                
+                if (i == -1) {
+                    name = namevalue
+                    value = true
+                }
+                else {
+                    name = namevalue.substring(0, i)
+                    value = namevalue.substring(i + 1, namevalue.size())
+                }
+                name = name.trim()
+                
+                properties[name] = value
+            }
+            
+            values.each {
+                addProperty(it)
+            }
+        }
         
-        // -J
+        if (line.hasOption('J')) {
+            def values = line.getOptionValues('J')
+            
+            values.each {
+                javaFlags << it
+            }
+        }
         
         return false
     }
@@ -230,6 +263,14 @@
                 else {
                     log.warn("Missing Java Agent jar: $javaAgentJar")
                 }
+            }
+            
+            properties.each { key, value ->
+                sysproperty(key: key, value: value)
+            }
+            
+            javaFlags.each {
+                jvmarg(value: it)
             }
             
             // Set the properties which we pass to the JVM from the startup script



Mime
View raw message