ARTEMIS-619 stop components along with server

This commit is contained in:
jbertram 2016-07-08 13:23:04 -05:00
parent db578d37ad
commit 17cf45ad4f
2 changed files with 9 additions and 7 deletions

View File

@ -102,6 +102,13 @@ public class Run extends LockAbstract {
fileConfiguration.getLargeMessagesLocation().mkdirs(); 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. * Add a simple shutdown hook to stop the server.
* *
@ -139,7 +146,7 @@ public class Run extends LockAbstract {
if (file.exists()) { if (file.exists()) {
try { try {
try { try {
server.stop(); stopServerAndComponenets();
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -162,7 +169,7 @@ public class Run extends LockAbstract {
@Override @Override
public void run() { public void run() {
try { try {
server.stop(); stopServerAndComponenets();
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -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 resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase(warDir.toString()); resourceHandler.setResourceBase(warDir.toString());
resourceHandler.setDirectoriesListed(true); resourceHandler.setDirectoriesListed(true);