/** * Returns the current state of the call. * * @return the state of the call */ public State getState() { return versionToState(currentVersion.get()); }
/** * Returns the current continuation of this call. * * <p>The call must be in the paused state; otherwise, an {@link IllegalStateException} is * thrown.</p> * * @return the current continuation of the call * * @throws IllegalStateException if this call is not in the paused state */ public OneShotContinuation getCurrentContinuation() { int version = currentVersion.get(); if (!isPaused(version)) { State s = versionToState(version); throw new IllegalStateException("Cannot get continuation of a " + s + " call"); } else { return new CallContinuation(version); } }