summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2008-09-02 14:28:52 +0000
committerMartin Ritchie <ritchiem@apache.org>2008-09-02 14:28:52 +0000
commita4a817ee357974574ff6aee558c64bcb0121d7c0 (patch)
tree2203c28bc116653c3cc6642bc512cac3eb9cc0ad /java
parent588895300b227c45c1c2bf94a8c74b018c269821 (diff)
downloadqpid-python-a4a817ee357974574ff6aee558c64bcb0121d7c0.tar.gz
QPID-579 : Make broker stop on startup errors
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@691262 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/Main.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/Main.java b/java/broker/src/main/java/org/apache/qpid/server/Main.java
index 8ad2ace1b2..f3b54034e7 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/Main.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/Main.java
@@ -198,23 +198,31 @@ public class Main
{
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);