[bs-28] Add /shutdown endpoint to service apps

Disabled by default use container.allow_shutdown=true to switch
it on.  Then POST to /shutdown to shut down the app.

[#48059059]
This commit is contained in:
Dave Syer
2013-04-30 10:17:39 +01:00
parent c4028656ef
commit 361f500ed5
8 changed files with 160 additions and 5 deletions

View File

@@ -56,7 +56,11 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
@Override
public synchronized void stop() {
try {
this.server.setGracefulShutdown(10000);
this.server.stop();
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
// No drama
} catch (Exception ex) {
throw new EmbeddedServletContainerException(
"Unable to stop embedded Jetty servlet container", ex);