Class ThreadlocalInheritingCompletableFuture<T>

  • All Implemented Interfaces:
    java.util.concurrent.CompletionStage<T>, java.util.concurrent.Future<T>

    public class ThreadlocalInheritingCompletableFuture<T>
    extends java.util.concurrent.CompletableFuture<T>
    This custom future implementation enables inheritance of Threadlocal variables.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture

        java.util.concurrent.CompletableFuture.AsynchronousCompletionTask
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <U> java.util.concurrent.CompletableFuture<U> completedFuture​(U value)
      Returns a new CompletableFuture that is already completed with the given value.
      java.util.concurrent.Executor defaultExecutor()  
      <U> java.util.concurrent.CompletableFuture<U> newIncompleteFuture()  
      • Methods inherited from class java.util.concurrent.CompletableFuture

        acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedStage, completeExceptionally, completeOnTimeout, copy, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ThreadlocalInheritingCompletableFuture

        public ThreadlocalInheritingCompletableFuture()
    • Method Detail

      • completedFuture

        public static <U> java.util.concurrent.CompletableFuture<U> completedFuture​(U value)
        Returns a new CompletableFuture that is already completed with the given value.
        Type Parameters:
        U - the type of the value
        Parameters:
        value - the value
        Returns:
        the completed CompletableFuture
      • defaultExecutor

        public java.util.concurrent.Executor defaultExecutor()
        Overrides:
        defaultExecutor in class java.util.concurrent.CompletableFuture<T>
      • newIncompleteFuture

        public <U> java.util.concurrent.CompletableFuture<U> newIncompleteFuture()
        Overrides:
        newIncompleteFuture in class java.util.concurrent.CompletableFuture<T>