WebAppConfig webAppConfig = new WebAppConfig();
webAppConfig.setId(_serviceName);
webAppConfig.setRootDirectory(new RawString("memory:/admin-dummy-root"));
hostConfig.addBuilderProgram(new PropertyValueProgram("web-app", webAppConfig));
ServletMapping servlet = new ServletMapping();
servlet.setServletName(_serviceName);
servlet.addURLPattern("/*");
servlet.addURLRegexp(".*");
servlet.setServletClass(ManagementServlet.class.getName());
ContainerProgram servletInit = new ContainerProgram();
servletInit.addProgram(new PropertyValueProgram("service", this));
servlet.setInit(servletInit);
webAppConfig.addBuilderProgram(new PropertyValueProgram("servlet-mapping", servlet));
SecurityConstraint constraint = new SecurityConstraint();
constraint.addURLPattern("/*");
constraint.addConstraint(new HmuxConstraint(this));
constraint.init();
webAppConfig.addBuilderProgram(new PropertyValueProgram("security-constraint", constraint));
try {
_allowedNetworks = new InetNetwork[] {
new InetNetwork(InetAddress.getByName("127.0.0.1"), 24),
new InetNetwork(InetAddress.getByName("10.0.0.0"), 24),