ARTEMIS-619 stop components along with server
This commit is contained in:
parent
db578d37ad
commit
17cf45ad4f
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue