Package com.caucho.server.cluster

Examples of com.caucho.server.cluster.Server


   * Sets the persistent store type.
   */
  public void setType(String type)
    throws ConfigException
  {
    Server server = Server.getCurrent();
   
    _type = type;
  }
View Full Code Here


      FilterChain rewriteChain = _rewriteDispatch.map(url,
                  queryString,
                  chain);

      if (rewriteChain != chain) {
        Server server = (Server) _dispatchServer;
  WebApp webApp = server.getDefaultWebApp();
        invocation.setWebApp(webApp);

  if (webApp != null) {
    rewriteChain = new WebAppFilterChain(rewriteChain, webApp);
View Full Code Here

    }

    if (annotated.isAnnotationPresent(AdminService.class)) {
      AdminService service = annotated.getAnnotation(AdminService.class);

      Server server = Server.getCurrent();

      if (server == null) {
        throw new ConfigException(L
            .l("@AdminService requires an active Resin Server."));
      }

      if (!server.isWatchdog()) {
        HempBroker broker = (HempBroker) server.getAdminBroker();

        broker.addStartupActor(event.getBean(), service.name(), service
            .threadMax());
      }
    }
View Full Code Here

      _serverSocket.setTcpNoDelay(_tcpNoDelay);

    _serverSocket.setConnectionSocketTimeout((int) getSocketTimeout());

    if (_serverSocket.isJni()) {
      Server server = Server.getCurrent();

      if (server != null)
        _selectManager = server.getSelectManager();

      /*
      if (_selectManager == null) {
        throw new IllegalStateException(L.l("Cannot load select manager"));
      }
View Full Code Here

      int code = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
      FilterChain chain = new ErrorFilterChain(code);
      invocation.setFilterChain(chain);

      if (_dispatchServer instanceof Server) {
        Server server = (Server) _dispatchServer;
        invocation.setWebApp(getErrorWebApp());
      }

      invocation.setDependency(AlwaysModified.create());

      return invocation ;
    }

    FilterChain chain;

    WebApp app = getWebApp(invocation, true);

    boolean isAlwaysModified;

    if (app != null) {
      invocation = app.buildInvocation(invocation);
      chain = invocation.getFilterChain();
      isAlwaysModified = false;
    }
    else {
      int code = HttpServletResponse.SC_NOT_FOUND;
      chain = new ErrorFilterChain(code);
      ContextFilterChain contextChain = new ContextFilterChain(chain);
      contextChain.setErrorPageManager(_errorPageManager);
      chain = contextChain;
      invocation.setFilterChain(contextChain);
      isAlwaysModified = true;
    }

    if (_rewriteDispatch != null) {
      String uri = invocation.getURI();
      String queryString = invocation.getQueryString();

      FilterChain rewriteChain = _rewriteDispatch.map(uri,
                                                      queryString,
                                                      chain);

      if (rewriteChain != chain) {
        Server server = (Server) _dispatchServer;
        // server/13sf, server/1kq1
        WebApp webApp = findWebAppByURI("/");

        if (webApp != null)
          invocation.setWebApp(webApp);
View Full Code Here

    if (_url != null && ! "".equals(_url))
      return _url;
    else if (_hostName == null
             || _hostName.equals("")
             || _hostName.equals("default")) {
      Server server = getServer();

      if (server == null)
        return "http://localhost";

      for (SocketLinkListener port : server.getPorts()) {
        if ("http".equals(port.getProtocolName())) {
          String address = port.getAddress();

          if (address == null || address.equals(""))
            address = "localhost";

          return "http://" + address + ":" + port.getPort();
        }
      }

      for (SocketLinkListener port : server.getPorts()) {
        if ("https".equals(port.getProtocolName())) {
          String address = port.getAddress();
          if (address == null || address.equals(""))
            address = "localhost";
View Full Code Here

  /**
   * Returns the current cluster.
   */
  public Cluster getCluster()
  {
    Server server = getServer();

    if (server != null)
      return server.getCluster();
    else
      return null;
  }
View Full Code Here

    return lifetimeReadBytes;
  }

  public long getRequestWriteBytesTotal()
  {
    Server server = _server;

    if (server == null)
      return -1;

    long lifetimeWriteBytes = 0;

    for (SocketLinkListener port : server.getPorts())
      lifetimeWriteBytes += port.getLifetimeWriteBytes();

    return lifetimeWriteBytes;
  }
View Full Code Here

    return lifetimeWriteBytes;
  }

  public long getClientDisconnectCountTotal()
  {
    Server server = _server;

    if (server == null)
      return -1;

    long lifetimeClientDisconnectCount = 0;

    for (SocketLinkListener port : server.getPorts())
      lifetimeClientDisconnectCount += port.getLifetimeClientDisconnectCount();

    return lifetimeClientDisconnectCount;
  }
View Full Code Here

    return lifetimeClientDisconnectCount;
  }

  public long getKeepaliveCountTotal()
  {
    Server server = _server;

    if (server == null)
      return -1;

    long lifetimeKeepaliveCount = 0;

    for (SocketLinkListener port : server.getPorts())
      lifetimeKeepaliveCount += port.getLifetimeKeepaliveCount();

    return lifetimeKeepaliveCount;
  }
View Full Code Here

TOP

Related Classes of com.caucho.server.cluster.Server

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.