From 17cf45ad4f20a82fc251bab291962c607f1b3d15 Mon Sep 17 00:00:00 2001 From: jbertram Date: Fri, 8 Jul 2016 13:23:04 -0500 Subject: [PATCH] ARTEMIS-619 stop components along with server --- .../org/apache/activemq/artemis/cli/commands/Run.java | 11 +++++++++-- .../artemis/component/WebServerComponent.java | 5 ----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java index d3c711dc57..3a0c6c97fb 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java @@ -102,6 +102,13 @@ public class Run extends LockAbstract { fileConfiguration.getLargeMessagesLocation().mkdirs(); } + private void stopServerAndComponenets() throws Exception { + for (ActiveMQComponent component : components) { + component.stop(); + } + server.stop(); + } + /** * Add a simple shutdown hook to stop the server. * @@ -139,7 +146,7 @@ public class Run extends LockAbstract { if (file.exists()) { try { try { - server.stop(); + stopServerAndComponenets(); } catch (Exception e) { e.printStackTrace(); @@ -162,7 +169,7 @@ public class Run extends LockAbstract { @Override public void run() { try { - server.stop(); + stopServerAndComponenets(); } catch (Exception e) { e.printStackTrace(); diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java index b857d5bb30..739edc0890 100644 --- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java +++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java @@ -98,11 +98,6 @@ public class WebServerComponent implements ExternalComponent { } } - WebAppContext handler = new WebAppContext(); - handler.setContextPath("/"); - handler.setResourceBase(warDir.toString()); - handler.setLogUrlOnStart(true); - ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setResourceBase(warDir.toString()); resourceHandler.setDirectoriesListed(true);