+ public void setHttpServer(HttpServer httpServer) {
+ this.httpServer = httpServer;
+ }
+
+ public void addHttpHandler(HttpHandler httpHandler, Map<String, String> properties) {
+ if (httpServer == null)
+ return;
+ final String contextPath = properties.get("contextPath");
+ httpServer.createContext(contextPath, httpHandler);
+ log.debug(() -> "Added handler " + contextPath + " : " + httpHandler.getClass().getName());
+
+ }
+
+ public void removeHttpHandler(HttpHandler httpHandler, Map<String, String> properties) {
+ if (httpServer == null)
+ return;
+ final String contextPath = properties.get("contextPath");
+ httpServer.removeContext(contextPath);
+ log.debug(() -> "Removed handler " + contextPath + " : " + httpHandler.getClass().getName());
+ }