qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r691262 - /incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
Date Tue, 02 Sep 2008 14:28:53 GMT
Author: ritchiem
Date: Tue Sep  2 07:28:52 2008
New Revision: 691262

URL: http://svn.apache.org/viewvc?rev=691262&view=rev
Log:
QPID-579 : Make broker stop on startup errors

Modified:
    incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java

Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java?rev=691262&r1=691261&r2=691262&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java Tue
Sep  2 07:28:52 2008
@@ -198,23 +198,31 @@
             {
                 System.out.println(e.getMessage());
                 _brokerLogger.error("Initialisation Error : " + e.getMessage());
-
+                shutdown(1);
             }
             catch (ConfigurationException e)
             {
                 System.out.println("Error configuring message broker: " + e);
                 _brokerLogger.error("Error configuring message broker: " + e);
                 e.printStackTrace();
+                shutdown(1);
             }
-            catch (Exception e)
+            catch (Throwable e)
             {
-                System.out.println("Error intialising message broker: " + e);
-                _brokerLogger.error("Error intialising message broker: " + e);
+                System.out.println("Error initialising message broker: " + e);
+                _brokerLogger.error("Error initialising message broker: " + e);
                 e.printStackTrace();
+                shutdown(1);
             }
         }
     }
 
+    protected void shutdown(int status)
+    {
+        ApplicationRegistry.removeAll();
+        System.exit(status);
+    }
+
     protected void startup() throws InitException, ConfigurationException, Exception
     {
         final String QpidHome = System.getProperty(QPID_HOME);



Mime
View raw message