Package com.caucho.network.balance

Examples of com.caucho.network.balance.ClientSocketFactory


  }

  @Override
  public long getConnectionBusyCountTotal()
  {
    ClientSocketFactory pool = _server.getClusterSocketPool();

    if (pool != null)
      return pool.getBusyCountTotal();
    else
      return 0;
  }
View Full Code Here


  }

  @Override
  public Date getLastBusyTime()
  {
    ClientSocketFactory pool = _server.getClusterSocketPool();

    if (pool != null)
      return pool.getLastBusyTime();
    else
      return null;
  }
View Full Code Here

  }

  @Override
  public long getConnectionKeepaliveCountTotal()
  {
    ClientSocketFactory pool = _server.getClusterSocketPool();

    if (pool != null)
      return pool.getKeepaliveCountTotal();
    else
      return 0;
  }
View Full Code Here

  }

  @Override
  public double getServerCpuLoadAvg()
  {
    ClientSocketFactory pool = _server.getClusterSocketPool();

    if (pool != null)
      return pool.getCpuLoadAvg();
    else
      return 0;
  }
View Full Code Here

  }

  @Override
  public void start()
  {
    ClientSocketFactory pool = _server.getLoadBalanceSocketPool();

    if (pool != null)
      pool.start();
  }
View Full Code Here

  }

  @Override
  public void stop()
  {
    ClientSocketFactory pool = _server.getLoadBalanceSocketPool();

    if (pool != null)
      pool.stop();
  }
View Full Code Here

  }

  @Override
  public void enableSessionOnly()
  {
    ClientSocketFactory pool = _server.getLoadBalanceSocketPool();

    if (pool != null)
      pool.enableSessionOnly();
  }
View Full Code Here

  }

  @Override
  public boolean ping()
  {
    ClientSocketFactory pool = _server.getClusterSocketPool();

    if (pool != null)
      return pool.canConnect();
    else
      return true;
  }
View Full Code Here

  /**
   * Returns true if the server is remote and active.
   */
  public final boolean isActiveRemote()
  {
    ClientSocketFactory pool = _serverPool;

    return pool != null && pool.isActive();
  }
View Full Code Here

    _admin.register();
  }

  private ClientSocketFactory createServerPool(String serverId)
  {
    ClientSocketFactory pool = new ClientSocketFactory(serverId,
                                     getId(),
                                     "Resin|Cluster",
                                     getStatId(),
                                     getAddress(),
                                     getPort(),
                                     isSSL());

    pool.setLoadBalanceConnectTimeout(getLoadBalanceConnectTimeout());
    pool.setLoadBalanceConnectionMin(getLoadBalanceConnectionMin());
    pool.setLoadBalanceSocketTimeout(getLoadBalanceSocketTimeout());
    pool.setLoadBalanceIdleTime(getLoadBalanceIdleTime());
    pool.setLoadBalanceRecoverTime(getLoadBalanceRecoverTime());
    pool.setLoadBalanceWarmupTime(getLoadBalanceWarmupTime());
    pool.setLoadBalanceWeight(getLoadBalanceWeight());
   
    return pool;
  }
View Full Code Here

TOP

Related Classes of com.caucho.network.balance.ClientSocketFactory

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.