String componentsXML = serverConfig.getParam("components.file", "components.xml");
HttpHandlerFactory factory = new DefaultHttpHandlerFactory(
componentsXML, getClass().getClassLoader());
HostRequestHandlerResolver hostResolver = new HostRequestHandlerResolver();
HostServiceConfig hostConfig = new ServiceConfigParser(serverConfig).getConfig();
for (String host : hostConfig.getHosts()) {
HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
ServiceConfig serviceConfig = hostConfig.getServiceConfig(host);
for (ServiceUrl serviceUrl : serviceConfig.getServiceUrlList()) {
HttpHandler handler = factory.getHttpHandler(serviceUrl);
if (handler != null) {
LOG.info(serviceUrl.getPath() + " - " + handler.getClass().getName());
registry.register(serviceUrl.getPath() + "*", handler);