diff options
author | Martin Ritchie <ritchiem@apache.org> | 2008-09-02 14:28:52 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2008-09-02 14:28:52 +0000 |
commit | d3b8773888202a69c6df43a7783cc7faed667aeb (patch) | |
tree | e08f04abe831613d254d26bf55af7b5f64feae3c | |
parent | 082a66b195c67e95624707d5e8f0c17dd3ef3dfb (diff) | |
download | qpid-python-d3b8773888202a69c6df43a7783cc7faed667aeb.tar.gz |
QPID-579 : Make broker stop on startup errors
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@691262 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java index 8ad2ace1b2..f3b54034e7 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java +++ b/qpid/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); |