Examples of WebAppConfig


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

Examples of com.caucho.server.webapp.WebAppConfig

                        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

Examples of com.caucho.server.webapp.WebAppConfig

      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

Examples of com.caucho.server.webapp.WebAppConfig

      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

Examples of com.caucho.server.webapp.WebAppConfig

      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

Examples of com.caucho.server.webapp.WebAppConfig

      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

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()));

        config.addBuilderProgram(new WebAppProgram(webApp));

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

Examples of com.caucho.server.webapp.WebAppConfig

      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

Examples of org.apache.beehive.netui.tools.testrecorder.shared.config.WebappConfig

    public void doLink( HttpServletRequest request, HttpServletResponse response )
            throws IOException, ServletException, ConfigException {
        String sessionName = request.getParameter( Constants.FILE );
        TestDefinition test = getTest( sessionName );
        WebappConfig config = TestRecorderFilter.instance().getWebapp();
        try {
            if ( test == null ) {
                String msg = "No test was found for name( " + sessionName + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }

            File recFile = getRecordSessionFile( test );
            if ( !recFile.exists() ) {
                String msg = "No file was found for test( " + test.getName() + " ), file( " +
                        recFile.getAbsolutePath() + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }

            RecordSessionBean bean = null;
            try {
                bean = XMLHelper.getRecordSessionBean( recFile );
            }
            catch ( SessionXMLException e ) {
                String msg = "Failed processing file for record session( " + test.getName() + " ), file( " +
                        recFile.getAbsolutePath() + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }
            RequestData rd = bean.getRequestData( 0 );
            if ( rd == null ) {
                String msg = "Unable to find the first request in the test ( " + test.getName() + " ), file( " +
                        recFile.getAbsolutePath() + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }
            String host = config.getServer().getHostname();
            if ( host.equals( "localhost" ) )
            {
                host = request.getServerName();
            }
            response.sendRedirect( rd.getUri( host, config.getServer().getPort() ) );
            return;
        }
        catch ( Exception e ) {
            String msg = "ERROR: failed to display test details, exception( " + e.getMessage() +
                    " ), test( " + test.getName() + " )";
View Full Code Here

Examples of org.apache.beehive.netui.tools.testrecorder.shared.config.WebappConfig

            throw new RuntimeConfigException( msg );
        }
        // Delete results file for all webapps used, create results directory if it doesn't exist
        // TODO move to server to allow for playback from remote server
        Iterator it = webappMap.values().iterator();
        WebappConfig webapp = null;
        while ( it.hasNext() ) {
            webapp = (WebappConfig) it.next();
            // delete all results only if requested
            if ( delete ) {
                log.info( "Deleting results for webapp( " + webapp.getName() + " )" );
                if ( !webapp.deleteResults() ) {
                    String msg = "WARNING: unable to delete all results files for webapp( " + webapp.getName() +
                            " )";
                    System.out.println( msg );
                    log.warn( msg );
                }
            }
            if ( !webapp.createResultsDirectory() ) {
                String msg = "ERROR: unable to create results directory( " + webapp.getResultsDirectory() +
                        " ), for webapp( " + webapp.getName() + " )";
                System.err.println( msg );
                log.error( msg );
                throw new RuntimeConfigException( msg );
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.