geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r947527 - /geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
Date Mon, 24 May 2010 02:57:15 GMT
Author: gawor
Date: Mon May 24 02:57:15 2010
New Revision: 947527

URL: http://svn.apache.org/viewvc?rev=947527&view=rev
Log:
GERONIMO-5333: Check exit code from main before deciding how to shutdown the framework

Modified:
    geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java

Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java?rev=947527&r1=947526&r2=947527&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
Mon May 24 02:57:15 2010
@@ -57,23 +57,25 @@ public class Bootstrapper extends Framew
             destroy(false);
             return -1;
         }
-
-        int exitCode = 0;
         
         ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader();
         try {
             ClassLoader newTCCL = geronimoMain.getClass().getClassLoader();
             Thread.currentThread().setContextClassLoader(newTCCL);
-            exitCode = geronimoMain.execute(opaque);
-            destroy(waitForStop);
+            int exitCode = geronimoMain.execute(opaque);
+            if (exitCode == 0) {
+                destroy(waitForStop);
+            } else {
+                destroy(false);
+            }
+            return exitCode;
         } catch (Throwable e) {
             System.err.println("Error in Main: " + e);
             destroy(false);
+            return -1;
         } finally {
             Thread.currentThread().setContextClassLoader(oldTCCL);
         }
-        
-        return exitCode;
     }
 
     public Main getMain() {



Mime
View raw message