Interface CheckedFuture<V,​X extends java.lang.Exception>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      V checkedGet()
      Exception checking version of Future.get() that will translate InterruptedException, CancellationException and ExecutionException into application-specific exceptions.
      V checkedGet​(long timeout, java.util.concurrent.TimeUnit unit)
      Exception checking version of Future.get(long, TimeUnit) that will translate InterruptedException, CancellationException and ExecutionException into application-specific exceptions.
      • Methods inherited from interface java.util.concurrent.Future

        cancel, get, get, isCancelled, isDone
    • Method Detail

      • checkedGet

        V checkedGet()
              throws X extends java.lang.Exception
        Exception checking version of Future.get() that will translate InterruptedException, CancellationException and ExecutionException into application-specific exceptions.
        Returns:
        the result of executing the future.
        Throws:
        X - on interruption, cancellation or execution exceptions.
        X extends java.lang.Exception
      • checkedGet

        V checkedGet​(long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.util.concurrent.TimeoutException,
                     X extends java.lang.Exception
        Exception checking version of Future.get(long, TimeUnit) that will translate InterruptedException, CancellationException and ExecutionException into application-specific exceptions. On timeout this method throws a normal TimeoutException.
        Returns:
        the result of executing the future.
        Throws:
        java.util.concurrent.TimeoutException - if retrieving the result timed out.
        X - on interruption, cancellation or execution exceptions.
        X extends java.lang.Exception