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(); } }
public Future<Boolean> getStopFuture() { if (!_state.isRunning()) return new RuntimeFuture(true, _stopException); try { _lock.lock(); return newFuture(_stopFutures); } finally { _lock.unlock(); } }
public Future<Boolean> getStartFuture() { if (_state.isRunning()) return new RuntimeFuture(true, null); try { _lock.lock(); return newFuture(_startFutures); } finally { _lock.unlock(); } }