private void setupHttpHandler() { serverConfig.addJmxEventListener(httpHandlerChain); synchronized (serverConfig.handlersSync) { for (final HttpHandler httpHandler : serverConfig.orderedHandlers) { final String[] mappings = serverConfig.handlers.get(httpHandler); httpHandlerChain.addHandler(httpHandler, mappings); } } httpHandlerChain.start(); }
/** Modifies handlers mapping during runtime. */ synchronized void onRemoveHttpHandler(HttpHandler httpHandler) { if (isStarted()) { httpHandlerChain.removeHttpHandler(httpHandler); } }
/** Modifies handlers mapping during runtime. */ synchronized void onAddHttpHandler(HttpHandler httpHandler, String[] mapping) { if (isStarted()) { httpHandlerChain.addHandler(httpHandler, mapping); } }
private void tearDownHttpHandler() { httpHandlerChain.destroy(); }