You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/08/20 21:22:30 UTC
svn commit: r567793 -
/geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
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