Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 22992 invoked from network); 2 Aug 2007 10:13:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 10:13:58 -0000 Received: (qmail 30550 invoked by uid 500); 2 Aug 2007 10:13:57 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 30499 invoked by uid 500); 2 Aug 2007 10:13:57 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 30483 invoked by uid 99); 2 Aug 2007 10:13:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 03:13:57 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 10:13:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 136941A981A; Thu, 2 Aug 2007 03:13:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r562068 - /geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy Date: Thu, 02 Aug 2007 10:13:34 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070802101336.136941A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Thu Aug 2 03:13:29 2007 New Revision: 562068 URL: http://svn.apache.org/viewvc?view=rev&rev=562068 Log: merge in other bits from geronimo:start 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?view=diff&rev=562068&r1=562067&r2=562068 ============================================================================== --- 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 Thu Aug 2 03:13:29 2007 @@ -112,9 +112,66 @@ geronimoHome = new File(System.properties['gshell.home']) } - println "Geronimo home: $geronimoHome" + log.info("Geronimo home: $geronimoHome") ant.java(jar: "$geronimoHome/bin/server.jar", dir: geronimoHome, failonerror: true, fork: true) { + def node = current.wrapper + + if (timeout > 0) { + log.info("Timeout after: ${timeout} seconds") + node.setAttribute('timeout', "${timeout * 1000}") + } + + /* + if (maximumMemory) { + node.setAttribute('maximumMemory', maximumMemory) + } + + if (javaVirtualMachine) { + if (!javaVirtualMachine.exists()) { + fail("Java virtual machine is not valid: $javaVirtualMachine") + } + + log.info("Using Java virtual machine: $javaVirtualMachine") + node.setAttribute('jvm', javaVirtualMachine.canonicalPath) + } + + if (logOutput) { + def file = getLogFile() + + FileUtils.forceMkdir(file.parentFile) + + log.info("Redirecting output to: $file") + redirector(output: file) + } + */ + + // + // TODO: Make this optional, so it can be disabled if needed for some reason + // + + // Load the Java programming language agent for JPA if the jar exists + def javaAgentJar = new File(geronimoHome, 'bin/jpa.jar') + if (javaAgentJar.exists()) { + jvmarg(value: "-javaagent:${javaAgentJar.canonicalPath}") + } + else { + log.warn("Missing JPA agent jar: $javaAgentJar") + } + + // Propagate some properties from Maven to the server if enabled + if (propagateGeronimoProperties) { + System.properties.each { name, value -> + if (name == 'geronimo.bootstrap.logging.enabled') { + // Skip this property, never propagate it + } + else if (name.startsWith('org.apache.geronimo') || name.startsWith('geronimo')) { + log.debug("Propagating: $name=$value") + sysproperty(key: name, value: value) + } + } + } + // Set the properties which we pass to the JVM from the startup script sysproperty(key: 'org.apache.geronimo.base.dir', file: geronimoHome) sysproperty(key: 'java.io.tmpdir', value: 'var/temp') // Use relative path @@ -135,6 +192,22 @@ if (veryverbose) { arg(value: '--veryverbose') } + + /* + if (startModules != null) { + if (startModules.length == 0) { + fail('At least one module name must be configured with startModule') + } + + log.info('Overriding the set of modules to be started') + + arg(value: '--override') + + startModules.each { + arg(value: "$it") + } + } + */ } return Command.SUCCESS @@ -154,116 +227,8 @@ if (!geronimoHome.exists()) { fail("Missing pre-installed assembly directory: $geronimoHome") - } - } - - // - // TODO: Use ProcessLauncher - // - - // Holds and exceptions that were thrown during execution - def errors = [] - - def runner = { - try { - // - // TODO: Do we want to use the repository, and list out the jars here explicity? - // - - ant.java(jar: "$geronimoHome/bin/server.jar", dir: geronimoHome, failonerror: true, fork: true) { - def node = current.wrapper - - if (timeout > 0) { - log.info("Timeout after: ${timeout} seconds") - node.setAttribute('timeout', "${timeout * 1000}") - } - - if (maximumMemory) { - node.setAttribute('maximumMemory', maximumMemory) - } - - if (javaVirtualMachine) { - if (!javaVirtualMachine.exists()) { - fail("Java virtual machine is not valid: $javaVirtualMachine") - } - - log.info("Using Java virtual machine: $javaVirtualMachine") - node.setAttribute('jvm', javaVirtualMachine.canonicalPath) - } - - if (logOutput) { - def file = getLogFile() - FileUtils.forceMkdir(file.parentFile) - - log.info("Redirecting output to: $file") - redirector(output: file) - } - - // - // TODO: Make this optional, so it can be disabled if needed for some reason - // - - // Load the Java programming language agent for JPA if the jar exists - def javaAgentJar = new File(geronimoHome, 'bin/jpa.jar') - if (javaAgentJar.exists()) { - jvmarg(value: "-javaagent:${javaAgentJar.canonicalPath}") - } - else { - log.warn("Missing JPA agent jar: $javaAgentJar") - } - - // Propagate some properties from Maven to the server if enabled - if (propagateGeronimoProperties) { - System.properties.each { name, value -> - if (name == 'geronimo.bootstrap.logging.enabled') { - // Skip this property, never propagate it - } - else if (name.startsWith('org.apache.geronimo') || name.startsWith('geronimo')) { - log.debug("Propagating: $name=$value") - sysproperty(key: name, value: value) - } - } - } - - // - // TODO: Support using a specific JVM executable - // - - // Set the properties which we pass to the JVM from the startup script - sysproperty(key: 'org.apache.geronimo.base.dir', file: geronimoHome) - sysproperty(key: 'java.io.tmpdir', value: 'var/temp') // Use relative path - sysproperty(key: 'java.endorsed.dirs', value: prefixSystemPath('java.endorsed.dirs', new File(geronimoHome, 'lib/endorsed'))) - sysproperty(key: 'java.ext.dirs', value: prefixSystemPath('java.ext.dirs', new File(geronimoHome, 'lib/ext'))) - - if (quiet) { - arg(value: '--quiet') - } - else { - arg(value: '--long') - } - - if (verbose) { - arg(value: '--verbose') - } - - if (veryverbose) { - arg(value: '--veryverbose') - } - - if (startModules != null) { - if (startModules.length == 0) { - fail('At least one module name must be configured with startModule') - } - - log.info('Overriding the set of modules to be started') - - arg(value: '--override') - - startModules.each { - arg(value: "$it") - } - } - } + + // TRIMMED... } catch (Exception e) { errors << e @@ -333,8 +298,8 @@ assert name assert file - String path = file.path - String prop = System.getProperty(name, '') + def path = file.path + def prop = System.getProperty(name, '') if (prop) { path += File.pathSeparator + prop }