public T get(long duration, TimeUnit units) throws InterruptedException,
      TimeoutException, ExecutionException {
    if (!latch.await(duration, units)) {
      // whenever timeout occurs, continuous timeout counter will increase by 1.
      MemcachedConnection.opTimedOut(op);
      if (op != null) { // op can be null on a flush
        op.timeOut();
      }
      throw new CheckedOperationTimeoutException(
          "Timed out waiting for operation", op);
    } else {
      // continuous timeout counter will be reset
      MemcachedConnection.opSucceeded(op);
    }
    if (op != null && op.hasErrored()) {
      throw new ExecutionException(op.getException());
    }
    if (isCancelled()) {
      throw new ExecutionException(new CancellationException("Cancelled"));
    }
    if (op != null && op.isTimedOut()) {
      throw new ExecutionException(new CheckedOperationTimeoutException(
          "Operation timed out.", op));
    }

    /* TODO: re-add assertion that op.getState() == OperationState.COMPLETE */

    return objRef.get();
  }
Get the results of the given operation.

As with the Future interface, this call will block until the results of
the future operation has been received.

@param duration amount of time to wait
@param units unit of time to wait
@return the operation results of this OperationFuture
@throws InterruptedException
@throws TimeoutException
@throws ExecutionException
src/main/java/net/spy/memcached/internal/OperationFuture.java