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();
|
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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue