Package com.caucho.server.webapp

Examples of com.caucho.server.webapp.WebAppConfig


      }

      thread.setContextClassLoader(_host.getClassLoader());

      for (WebAppEmbed webApp : _webAppList) {
        WebAppConfig config = new WebAppConfig();
        config.setContextPath(webApp.getContextPath());
        config.setRootDirectory(new RawString(webApp.getRootDirectory()));
       
        if (webApp.getArchivePath() != null)
          config.setArchivePath(new RawString(webApp.getArchivePath()));

        config.addBuilderProgram(new WebAppProgram(webApp));

        _host.getWebAppContainer().addWebApp(config);
      }
    } catch (Exception e) {
      throw ConfigException.create(e);
View Full Code Here


                        String rootDirectory)
  {
    try {
      start();

      WebAppConfig config = new WebAppConfig();
      config.setContextPath(contextPath);
      config.setRootDirectory(new RawString(rootDirectory));

      _host.getWebAppContainer().addWebApp(config);
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
View Full Code Here

      hostConfig.setHostName(new RawString(_hostName));
      hostConfig.setRootDirectory(new RawString("memory:/error/" + _hostName));
      hostConfig.setSkipDefaultConfig(true);
      hostConfig.setRedeployMode(DeployMode.MANUAL);

      WebAppConfig webAppConfig = new WebAppConfig();
      webAppConfig.setId("/");
      webAppConfig.setRootDirectory(new RawString("memory:/error/ROOT"));
      webAppConfig.setSkipDefaultConfig(true);
      webAppConfig.setRedeployMode(DeployMode.MANUAL);

      hostConfig.addPropertyProgram("web-app", webAppConfig);

      // host.addWebApp(webAppConfig);
     
      ServletMapping mapping = new ServletMapping();
      mapping.addURLPattern("/hmtp");
      mapping.setServletClass("com.caucho.remote.HmtpServlet");
      mapping.setInitParam("authentication-required",
                           String.valueOf(_isAuthenticationRequired));
      mapping.setInitParam("admin", "true");
      mapping.init();

      webAppConfig.addPropertyProgram("servlet-mapping", mapping);
     
      _server.addHost(hostConfig);
     
      if (log.isLoggable(Level.FINER))
        log.finer(this + " enabled at http://" + _hostName + "/hmtp");
View Full Code Here

      return;
    }
   
    HostConfig hostConfig = _management.getHostConfig();

    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),
View Full Code Here

      hostConfig.setHostName(new RawString(_hostName));
      hostConfig.setRootDirectory(new RawString("error:" + _hostName));
      hostConfig.setSkipDefaultConfig(true);
      hostConfig.setRedeployMode("manual");

      WebAppConfig webAppConfig = new WebAppConfig();
      webAppConfig.setId("/");
      webAppConfig.setRootDirectory(new RawString("error:/ROOT"));
      webAppConfig.setSkipDefaultConfig(true);
      webAppConfig.setRedeployMode("manual");

      hostConfig.addPropertyProgram("web-app", webAppConfig);

      // host.addWebApp(webAppConfig);
     
      ServletMapping mapping = new ServletMapping();
      mapping.addURLPattern("/hmtp");
      mapping.setServletClass("com.caucho.remote.HmtpServlet");
      mapping.setInitParam("authentication-required",
         String.valueOf(_isAuthenticationRequired));
      mapping.setInitParam("admin", "true");
      mapping.init();

      webAppConfig.addPropertyProgram("servlet-mapping", mapping);
     
      _server.addHost(hostConfig);

      if (log.isLoggable(Level.FINER))
  log.finer(this + " enabled at http://" + _hostName + "/hmtp");
View Full Code Here

      String rootDirectory)
  {
    try {
      start();

      WebAppConfig config = new WebAppConfig();
      config.setContextPath(contextPath);
      config.setRootDirectory(new RawString(rootDirectory));

      _host.addWebApp(config);
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
View Full Code Here

      }

      thread.setContextClassLoader(_host.getClassLoader());

      for (WebAppEmbed webApp : _webAppList) {
        WebAppConfig config = new WebAppConfig();
        config.setContextPath(webApp.getContextPath());
        config.setRootDirectory(new RawString(webApp.getRootDirectory()));

        config.addBuilderProgram(new WebAppProgram(webApp));

        _host.addWebApp(config);
      }
     
      _server.start();
View Full Code Here

      return;
    }
   
    HostConfig hostConfig = _management.getHostConfig();

    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),
View Full Code Here

TOP

Related Classes of com.caucho.server.webapp.WebAppConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.