JarHttpHandler jarHttpHandler = webappHttpHandlerFactory.createHandler(program.getJarLocation());
NettyHttpService.Builder builder = NettyHttpService.builder();
builder.addHttpHandlers(ImmutableSet.of(jarHttpHandler));
builder.setUrlRewriter(new WebappURLRewriter(jarHttpHandler));
builder.setHost(hostname.getCanonicalHostName());
NettyHttpService httpService = builder.build();
httpService.startAndWait();
final InetSocketAddress address = httpService.getBindAddress();
RunId runId = RunIds.generate();
// Register service, and the serving host names.
final List<Cancellable> cancellables = Lists.newArrayList();