Commit 4db3374e authored by Guus der Kinderen's avatar Guus der Kinderen Committed by daryl herzmann

OF-1436: Handle lifecycle of manually added Jetty Handlers. (#935)

This prevents errors (caused by the extensionHandlers to still be in 'running' state) when
restarting the HttpBindManager.
parent c49b09b3
...@@ -140,7 +140,7 @@ public final class HttpBindManager implements CertificateEventListener, Property ...@@ -140,7 +140,7 @@ public final class HttpBindManager implements CertificateEventListener, Property
/** /**
* Contains all Jetty handlers that are added as an extension. * Contains all Jetty handlers that are added as an extension.
* *
* This collection is mutabl. Handlers can be added and removed at runtime. * This collection is mutable. Handlers can be added and removed at runtime.
*/ */
private final HandlerCollection extensionHandlers = new HandlerCollection( true ); private final HandlerCollection extensionHandlers = new HandlerCollection( true );
...@@ -222,6 +222,7 @@ public final class HttpBindManager implements CertificateEventListener, Property ...@@ -222,6 +222,7 @@ public final class HttpBindManager implements CertificateEventListener, Property
try { try {
httpBindServer.start(); httpBindServer.start();
handlerList.start(); handlerList.start();
extensionHandlers.start();
CertificateManager.addListener(this); CertificateManager.addListener(this);
...@@ -239,6 +240,7 @@ public final class HttpBindManager implements CertificateEventListener, Property ...@@ -239,6 +240,7 @@ public final class HttpBindManager implements CertificateEventListener, Property
if (httpBindServer != null) { if (httpBindServer != null) {
try { try {
handlerList.stop(); handlerList.stop();
extensionHandlers.stop();
httpBindServer.stop(); httpBindServer.stop();
Log.info("HTTP bind service stopped"); Log.info("HTTP bind service stopped");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment