class BeforeCompletion {

  public synchronized void execute(CancelCriterion cancelCriterion) {
    started = true;
    waitUntilFinished(cancelCriterion);
    if (exception != null) {
      throw exception;
    }
  }

}