Package com.google.opengse.webapp

Examples of com.google.opengse.webapp.WebAppCollection


    Properties props = new Properties();
    props.setProperty("context", "foo");
    props.setProperty("contextdir", "/tmp/opengse");
    props.setProperty("javax.servlet.context.tempdir", "/tmp/opengse");

    WebAppCollection webapps
        = WebAppCollectionFactory.createWebAppCollectionWithOneContext(props, configBuilder.getConfiguration());

    webapps.startAll();
    ServletEngineConfiguration config
        = ServletEngineConfigurationImpl.create(-1, 5);
    ServletEngineFactory engineFactory
        = JNDIMain.lookup(ServletEngineFactory.class);
View Full Code Here


    Properties props = new Properties();
    props.setProperty("context", "foo");
    props.setProperty("contextdir", "/tmp/opengse");
    props.setProperty("javax.servlet.context.tempdir", "/tmp/opengse");

    WebAppCollection webapps
        = WebAppCollectionFactory.createWebAppCollectionWithOneContext(props, configBuilder.getConfiguration());

    webapps.startAll();
    ServletEngineConfiguration config
        = ServletEngineConfigurationImpl.create(-1, 5);
    ServletEngineFactory engineFactory
        = JNDIMain.lookup(ServletEngineFactory.class);
View Full Code Here

        rootWarOrDirectory = war;
      } else {
        nonRootWars.add(war);
      }
    }
    WebAppCollection webAppCollection;
    if (rootWarOrDirectory == null) {
      webAppCollection = WebAppCollectionFactory.create(props);
    } else {
      webAppCollection = deployRootWebapp(props, rootWarOrDirectory);
    }
    ServletContainerContext containerContext = webAppCollection.getContainerContext();
    List<WebApp> webapps = new ArrayList<WebApp>();
    for (File nonRootWar : nonRootWars) {
      webapps.add(deployWar(props, nonRootWar, containerContext));
    }
    for (WebApp webapp : webapps) {
      webAppCollection.addWebApp(webapp);
    }
    return webAppCollection;
  }
View Full Code Here

        rootWebappInfo = warOrDirectory;
      } else {
        nonRootWarsOrDirectories.add(warOrDirectory);
      }
    }
    WebAppCollection webAppCollection;
    if (rootWebappInfo == null) {
      webAppCollection = WebAppCollectionFactory.create(props);
    } else {
      webAppCollection = deployRootWebapp(props, rootWebappInfo);
    }
    ServletContainerContext containerContext = webAppCollection.getContainerContext();
    List<WebApp> webapps = new ArrayList<WebApp>();
    for (WebappDeployInfo nonRootWarOrDirectory : nonRootWarsOrDirectories) {
      webapps.add(deployWebapp(containerContext, nonRootWarOrDirectory));
    }
    for (WebApp webapp : webapps) {
      webAppCollection.addWebApp(webapp);
    }
    return webAppCollection;
  }
View Full Code Here

    // javax.servlet.http.HttpServletRequest.getContextPath() (ie. the root context)
    // so we use the "ROOT" context name (this is so we can have files called ROOT.war and not
    // "".war
    String context = "ROOT";
    // create a collection of webapps that just contains a single webapp
    WebAppCollection webapps
      = WebAppCollectionFactory.createWebAppCollectionWithOneContext(contextDir,
        context, configBuilder.getConfiguration());
    // start all of the webapps
    webapps.startAll();
    // create servlet engine configuration object
    ServletEngineConfiguration config
        = ServletEngineConfigurationImpl.create(PORT, MAX_THREADS);
    // the collection of webapps is our "request sink" (just done to illustrate)
    FilterChain requestSink = webapps;
View Full Code Here

    if (!jndiInitialized) {
      // add our configuration to JNDI
      JNDIMain.initialize(props);
      jndiInitialized = true;
    }
    WebAppCollection webapps = getWebAppCollection(props);
    if (webapps == null) {
      return;
    }
    String classpath = PropertiesUtil.getAliasedProperty(props, "classpath", null);
    if (classpath != null) {
      ClassLoader cl = Thread.currentThread().getContextClassLoader();
      if (cl != null && cl instanceof URLClassLoader) {
        URLClassLoader urlcl = (URLClassLoader) cl;
        urlcl = new URLClassLoader(classpathToUrls(classpath), urlcl);
        Thread.currentThread().setContextClassLoader(urlcl);
      }
    }
    ServletEngineFactory engineFactory
        = JNDIMain.lookup(ServletEngineFactory.class);
    ServletEngine engine = engineFactory.createServletEngine(
                webapps, new ServletEngineConfigurationImpl(props));
    webapps.startAll();
    engine.run();
  }
View Full Code Here

    // javax.servlet.http.HttpServletRequest.getContextPath() (ie. the root context)
    // so we use the "ROOT" context name (this is so we can have files called ROOT.war and not
    // .war
    String context = "ROOT";
    // create a collection of webapps that just contains a single webapp
    WebAppCollection webapps
      = WebAppCollectionFactory.createWebAppCollectionWithOneContext(contextDir,
        context, configBuilder.getConfiguration());
    // start all of the webapps
    webapps.startAll();
    // create servlet engine configuration object
    ServletEngineConfiguration config
        = ServletEngineConfigurationImpl.create(PORT, MAX_THREADS);
    // the collection of webapps is our "request sink" (just done to illustrate)
    FilterChain requestSink = webapps;
View Full Code Here

    File contextDir = new File(System.getProperty("java.io.tmpdir"));
    // We want "/foo" to be returned by
    // javax.servlet.http.HttpServletRequest.getContextPath()
    String context = "foo";
    // create a collection of webapps that just contains a single webapp
    WebAppCollection webapps
      = WebAppCollectionFactory.createWebAppCollectionWithOneContext(contextDir,
        context, configBuilder.getConfiguration());
    // start all of the webapps
    webapps.startAll();
    // create servlet engine configuration object
    ServletEngineConfiguration config
        = ServletEngineConfigurationImpl.create(PORT, MAX_THREADS);
    // the collection of webapps is our "request sink" (just done to illustrate)
    FilterChain requestSink = webapps;
View Full Code Here

TOP

Related Classes of com.google.opengse.webapp.WebAppCollection

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.