geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
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 GMT
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
         }



Mime
View raw message