@VisibleForTesting
    protected void initializeWebApp(Configuration conf) {
        webApp = new HsWebApp(history);
        InetSocketAddress bindAddress = HboxWebAppUtil.getJHSWebBindAddress(conf);
        // NOTE: there should be a .at(InetSocketAddress)
        WebApps.$for("jobhistory", HistoryClientService.class, this, "ws")
                .with(conf)
                .withHttpSpnegoKeytabKey(HboxConfiguration.HBOX_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
                .withHttpSpnegoPrincipalKey(HboxConfiguration.HBOX_WEBAPP_SPNEGO_USER_NAME_KEY)
                .at(NetUtils.getHostPortString(bindAddress))
                .build(webApp);

        HttpServer2 httpServer = webApp.httpServer();

        WebAppContext webAppContext = httpServer.getWebAppContext();
        WebAppContext appWebAppContext = new WebAppContext();
        appWebAppContext.setContextPath("/static/hboxWebApp");
        String appDir = getClass().getClassLoader().getResource("hboxWebApp").toString();
        appWebAppContext.setResourceBase(appDir);
        // appWebAppContext.addServlet(DefaultServlet.class, "/*");
        final String[] ALL_URLS = {"/*"};
        FilterHolder[] filterHolders = webAppContext.getServletHandler().getFilters();
        for (FilterHolder filterHolder : filterHolders) {
            if (!"guice".equals(filterHolder.getName())) {
                HttpServer2.defineFilter(
                        appWebAppContext,
                        filterHolder.getName(),
                        filterHolder.getClassName(),
                        filterHolder.getInitParameters(),
                        ALL_URLS);
            }
        }
        httpServer.addHandlerAtFront(appWebAppContext);
        try {
            httpServer.start();
            LOG.info("Web app " + webApp.name() + " started at "
                    + httpServer.getConnectorAddress(0).getPort());
        } catch (IOException e) {
            throw new WebAppException("Error starting http server", e);
        }

        String connectHost = HboxWebAppUtil.getJHSWebappURLWithoutScheme(conf).split(":")[0];
        HboxWebAppUtil.setJHSWebappURLWithoutScheme(
                conf, connectHost + ":" + webApp.getListenerAddress().getPort());
    }
This module is responsible for talking to the
JobClient (user facing).
history-server/src/main/java/net/qihoo/hbox/jobhistory/HistoryClientService.java