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 onAddHttpHandler(HttpHandler httpHandler, String[] mapping) { if (isStarted()) { httpHandlerChain.addHandler(httpHandler, mapping); } }