Class ClosingFuture.ValueAndCloser<V>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeAsync()
      Starts closing all closeable objects captured during the ClosingFuture's asynchronous operation on the Executors specified by calls to DeferredCloser#eventuallyClose(Closeable, Executor).
      V get()
      Returns the final value of the associated ClosingFuture, or throws an exception as Future.get() would.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public V get()
              throws java.util.concurrent.ExecutionException
        Returns the final value of the associated ClosingFuture, or throws an exception as Future.get() would.

        Because the asynchronous operation has already completed, this method is synchronous and returns immediately.

        Throws:
        java.util.concurrent.CancellationException - if the computation was cancelled
        java.util.concurrent.ExecutionException - if the computation threw an exception
      • closeAsync

        public void closeAsync()
        Starts closing all closeable objects captured during the ClosingFuture's asynchronous operation on the Executors specified by calls to DeferredCloser#eventuallyClose(Closeable, Executor).

        If any such calls specified MoreExecutors.directExecutor(), those objects will be closed synchronously.

        Idempotent: objects will be closed at most once.