Skip to content

Instantly share code, notes, and snippets.

@ljnelson
Created February 20, 2017 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljnelson/cc165ac5c0073e00edd8ffda953e170e to your computer and use it in GitHub Desktop.
Save ljnelson/cc165ac5c0073e00edd8ffda953e170e to your computer and use it in GitHub Desktop.
private final void stopHttpServers(@Observes final BeforeShutdown event) {
synchronized (this.startedHttpServers) {
for (final HttpServer httpServer : this.startedHttpServers) {
if (httpServer != null && httpServer.isStarted()) {
httpServer.shutdownNow();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment