예제 #1
0
  public Future<Boolean> getSuspendFuture() {
    if (!_state.isRunning())
      return new RuntimeFuture(
          false, new IllegalStateException("Runtime is not running, cannot be suspended"));

    if (_state.isSuspended()) return new RuntimeFuture(true, null);

    try {
      _lock.lock();

      return newFuture(_suspendFutures);
    } finally {
      _lock.unlock();
    }
  }
예제 #2
0
  public Future<Boolean> getStopFuture() {
    if (!_state.isRunning()) return new RuntimeFuture(true, _stopException);

    try {
      _lock.lock();
      return newFuture(_stopFutures);
    } finally {
      _lock.unlock();
    }
  }
예제 #3
0
  public Future<Boolean> getStartFuture() {
    if (_state.isRunning()) return new RuntimeFuture(true, null);

    try {
      _lock.lock();
      return newFuture(_startFutures);
    } finally {
      _lock.unlock();
    }
  }