Package com.caucho.server.webapp

Examples of com.caucho.server.webapp.WebApp


  /**
   * Adds a load-balance
   */
  public LoadBalanceRule createLoadBalance()
  {
    WebApp webApp = getRewriteDispatch().getWebApp();

    if (webApp == null)
      throw new ConfigException(L.l("<load-balance> requires a web-app.  Host-based <rewrite-dispatch> can not use <load-balance>."));

    return new LoadBalanceRule(getRewriteDispatch(), webApp);
View Full Code Here


  /**
   * Adds a proxy
   */
  public ProxyRule createProxy()
  {
    WebApp webApp = getRewriteDispatch().getWebApp();

    if (webApp == null)
      throw new ConfigException(L.l("<proxy> requires a web-app.  Host-based <rewrite-dispatch> can not use <proxy>."));

    return new ProxyRule(getRewriteDispatch(), webApp);
View Full Code Here

  @PostConstruct
  public void init()
    throws ConfigException
  {
    try {
      WebApp webApp = WebApp.getCurrent();

      _proxyServlet.init(webApp);

      if (webApp != null)
        webApp.addServlet(_servlet);
    }
    catch (ServletException ex) {
      throw ConfigException.create(ex);
    }
  }
View Full Code Here

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

            writeString(os, HMUX_MATCH, pattern);

            crc64 = Crc64.generate(crc64, pattern);
          }

          patternList = app.getServletIgnoreMappingPatterns();

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

            writeString(os, HMUX_IGNORE, pattern);
View Full Code Here

  private Filter _filter;

  public RewriteFilterAdapter(Filter filter)
    throws ServletException
  {
    WebApp webApp = WebApp.getCurrent();
    FilterConfigImpl filterConfig = new FilterConfigImpl();
    filterConfig.setServletContext(webApp);

    filter.init(filterConfig);
View Full Code Here

    throws ConfigException
  {
    try {
      _proxyServlet.init();

      WebApp webApp = WebApp.getCurrent();

      if (webApp != null)
        webApp.addServlet(_servlet);
    }
    catch (ServletException ex) {
      throw ConfigException.create(ex);
    }
  }
View Full Code Here

      return AuthorizationResult.DEFAULT_ALLOW;
   
    if (request.isSecure())
      return AuthorizationResult.DEFAULT_ALLOW;

    WebApp webApp = (WebApp) application;
    Host host = webApp.getHost();
    String secureHost = host.getSecureHostName();

    if (secureHost != null) {
      String url = ("https://" + secureHost + webApp.getContextPath()
                    + request.getServletPath());

      if (request.getPathInfo() != null)
        url += request.getPathInfo();
      if (request.getQueryString() != null)
View Full Code Here

  {
    String contextPath = "";

    SessionManager manager = _manager;
    if (manager != null) {
      WebApp webApp = manager.getWebApp();

      if (webApp != null)
        contextPath = "," + webApp.getContextPath();
    }

    return getClass().getSimpleName() + "[" + getId() + contextPath + "]";
  }
View Full Code Here

 
  private ArrayList<String> _welcomeFileList = new ArrayList<String>();
 
  public WelcomeFile()
  {
    WebApp webApp = WebApp.getCurrent();
   
    if (webApp == null)
      throw new IllegalStateException(L.l("{0} must have an active {1}.",
                                          WelcomeFile.class.getSimpleName(),
                                          WebApp.class.getSimpleName()));
View Full Code Here

  /**
   * Adds an error page
   */
  public void addErrorPage(ErrorPage errorPage)
  {
    WebApp webApp = getErrorWebApp();
   
    if (webApp != null)
      webApp.addErrorPage(errorPage);
  }
View Full Code Here

TOP

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

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.