Ejemplo n.º 1
0
  public String ac_set_control_$_1(Args args) {
    String mode = args.argv(0);
    String iString = args.getOpt("interval");
    long interval = 0L;
    if (iString != null) {
      interval = Long.parseLong(iString) * 1000L;
      if (interval < 30000L) {
        throw new IllegalArgumentException("interval must be greater than 30");
      }
    }

    switch (mode) {
      case "on":
        _flushController.setControl(true);
        break;
      case "off":
        _flushController.setControl(false);
        break;
      default:
        throw new IllegalArgumentException("set control on|off");
    }
    if (interval > 0L) {
      _queueWatch.setGainControlTicker(interval);
    }
    return "";
  }
Ejemplo n.º 2
0
  @Override
  protected void startUp() throws Exception {
    _poolManager = new CellStub(this, new CellPath("PoolManager"), 30, SECONDS);
    Args args = getArgs();
    checkArgument(args.argc() >= 1, "Usage : ... <pgroup0> [<pgroup1>[...]]");

    for (int i = 0, n = args.argc(); i < n; i++) {
      _poolGroupList.add(args.argv(0));
      args.shift();
    }
    String tmp = args.getOpt("scheduler");
    if ((tmp != null) && (!tmp.equals(""))) {
      _eventDispatcher.loadHandler(tmp, false, args);
    }

    _queueWatch = new QueueWatch();

    tmp = args.getOpt("poolCollectionUpdate");
    if ((tmp != null) && (!tmp.equals(""))) {
      try {
        _getPoolCollectionTicker = Long.parseLong(tmp) * 60L * 1000L;
      } catch (Exception ee) {
        _log.warn(
            "Illegal value for poolCollectionUpdate : {} (choosing {} millis)",
            tmp,
            _getPoolCollectionTicker);
      }
    }
    tmp = args.getOpt("gainControlUpdate");
    if ((tmp != null) && (!tmp.equals(""))) {
      long gainControlTicker = 0L;
      try {
        _queueWatch.setGainControlTicker(gainControlTicker = Long.parseLong(tmp) * 60L * 1000L);
      } catch (Exception ee) {
        _log.warn(
            "Illegal value for gainControlUpdate : {} (choosing {} millis)",
            tmp,
            gainControlTicker);
      }
    }
    tmp = args.getOpt("timer");
    if ((tmp != null) && (!tmp.equals(""))) {
      try {
        _timerInterval = Long.parseLong(tmp) * 1000L;
      } catch (Exception ee) {
        _log.warn("Illegal value for timer : {} (choosing {} millis)", tmp, _timerInterval);
      }
    }
    useInterpreter(true);
  }