Package com.caucho.server.webapp

Examples of com.caucho.server.webapp.WebAppController


    if (hostName.equals(canonicalHostName)) {
      crc64 = queryCluster(os, host, crc64);

      WebAppContainer webAppContainer = host.getWebAppContainer();
     
      WebAppController controller = webAppContainer.findByURI(url);
      if (controller != null) {
        try {
          controller.request();
        } catch (Throwable e) {
          log.log(Level.WARNING, e.toString(), e);
        }
      }
View Full Code Here


    Path archivePath = null;

    if (contextUrl == null)
      contextUrl = webUri;

    WebAppController controller = null;

    if (webUri.endsWith(".war")) {
      // server/2a16
      String name = webUri.substring(0, webUri.length() - 4);
      int p = name.lastIndexOf('/');
      if (p > 0)
        name = name.substring(p + 1);

      // XXX:
      if (contextUrl.equals(""))
        contextUrl = "/" + name;

      if (contextUrl.endsWith(".war"))
        contextUrl = contextUrl.substring(0, contextUrl.length() - 4);

      Path expandPath = _webappsPath;

      try {
        expandPath.mkdirs();
      } catch (Exception e) {
        log.log(Level.WARNING, e.toString(), e);
      }

      archivePath = path;
      path = expandPath.lookup(name);
    } else {
      // server/2a15
      if (contextUrl.equals("")) {
        String name = webUri;
        int p = name.lastIndexOf('/');
        if (p > 0)
          name = name.substring(p + 1);
        contextUrl = "/" + name;
      }

      // server/2a17
      if (contextUrl.endsWith(".war"))
        contextUrl = contextUrl.substring(0, contextUrl.length() - 4);
    }

    if (! contextUrl.startsWith("/"))
      contextUrl = "/" + contextUrl;

    controller = findWebAppEntry(contextUrl);
   
    String id;
   
    if (contextUrl.equals("/"))
      id = "production/webapp/default/ROOT";
    else
      id = "production/webapp/default" + contextUrl;

    if (controller == null) {
      if (contextUrl.equals("/"))
        contextUrl = "";
     
      controller = new WebAppController(id,
                                        path,
                                        _webAppContainer,
                                        contextUrl);
     
      _webApps.add(controller);
    }

    if (archivePath != null)
      controller.setArchivePath(archivePath);
   
    controller.setDynamicDeploy(true);

    if (_configException != null)
      controller.setConfigException(_configException);

    for (WebAppConfig config : web.getWebAppList())
      controller.addConfigDefault(config);
  }
View Full Code Here

   * Returns any matching web-app.
   */
  public WebAppController findWebAppEntry(String name)
  {
    for (int i = 0; i < _webApps.size(); i++) {
      WebAppController controller = _webApps.get(i);

      if (controller.isNameMatch(name))
        return controller;
    }

    return null;
  }
View Full Code Here

  /**
   * Returns any matching web-app entry.
   */
  public WebAppController findWebAppEntry(String name)
  {
    WebAppController entry = _controller.findWebAppController(name);

    return entry;
  }
View Full Code Here

    WebAppController []webappList = host.getWebAppContainer().getWebAppList();

    WebAppMXBean []webapps = new WebAppMXBean[webappList.length];

    for (int i = 0; i < webapps.length; i++) {
      WebAppController controller = webappList[i];

      webapps[i] = controller.getAdmin();
    }

    return webapps;
  }
View Full Code Here

  {
    if (_app == null) {
      if (rootDirectory == null)
        rootDirectory = getAppDir();
     
      WebAppController controller
  = new WebAppController("""", rootDirectory, null);

      _app = controller.getDeployInstance();
    }

    return _app;
  }
View Full Code Here

    ArrayList appControllers = app.getParent().getWebAppList();

    for (int i = 0; i < appControllers.size(); i++)
    {
      WebAppController appController = (WebAppController) appControllers.get(i);

      String contextPath = appController.getContextPath();

      if (contextPath.startsWith("/resin-javadoc")) {
        japp = appController.getWebApp();
        break;
      }
    }

    if (japp != null) {
View Full Code Here

    ArrayList<WebAppController> webappList = host.getWebAppList();

    WebAppMXBean []webapps = new WebAppMXBean[webappList.size()];

    for (int i = 0; i < webapps.length; i++) {
      WebAppController controller = webappList.get(i);

      webapps[i] = controller.getAdmin();
    }

    return webapps;
  }
View Full Code Here

  /**
   * Returns any matching web-app entry.
   */
  public WebAppController findWebAppEntry(String name)
  {
    WebAppController entry = _controller.findWebAppController(name);

    return entry;
  }
View Full Code Here

    writeString(os, HMUX_HOST, canonicalHostName);

    if (hostName.equals(canonicalHostName)) {
      crc64 = queryCluster(os, host, crc64);
     
      WebAppController controller = host.findByURI(url);
      if (controller != null) {
  try {
    controller.request();
  } catch (Throwable e) {
    log.log(Level.WARNING, e.toString(), e);
  }
      }

      ArrayList<WebAppController> appList = host.getWebAppList();

      for (int i = 0; i < appList.size(); i++) {
  WebAppController appEntry = appList.get(i);

  if (appEntry.getParent() != null &&
      appEntry.getParent().isDynamicDeploy()) {
    continue;
  }
 
  writeString(os, HMUX_WEB_APP, appEntry.getContextPath());
  if (isLoggable)
    log.fine(dbgId() + "web-app '" + appEntry.getContextPath() + "'");

  crc64 = Crc64.generate(crc64, appEntry.getContextPath());

  WebApp app = appEntry.getWebApp();

  if (appEntry.isDynamicDeploy()) {
    writeString(os, HMUX_MATCH, "/*");
 
    crc64 = Crc64.generate(crc64, "/*");
   
    if (isLoggable)
      log.fine(dbgId() + "dynamic '" + appEntry.getContextPath() + "'");
  }
  else if (app == null || ! app.isActive()) {
    if (isLoggable)
      log.fine(dbgId() + "not active '" + appEntry.getContextPath() + "'");
   
    writeString(os, HMUX_WEB_APP_UNAVAILABLE, "");
  }
  else {
    if (isLoggable)
      log.fine(dbgId() + "active '" + appEntry.getContextPath() + "'");
    ArrayList<String> patternList = app.getServletMappingPatterns();

    for (int j = 0; patternList != null && j < patternList.size(); j++) {
      String pattern = patternList.get(j);

View Full Code Here

TOP

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

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.