Class CentralisedFuture<T>
java.lang.Object
java.util.concurrent.CompletableFuture<T>
space.arim.omnibus.util.concurrent.CentralisedFuture<T>
- Type Parameters:
T- the result type of the future
- All Implemented Interfaces:
CompletionStage<T>, Future<T>, ReactionStage<T>
- Direct Known Subclasses:
BaseCentralisedFuture, IndifferentCentralisedFuture
An extended
CompletableFuture API implementing ReactionStage.
This future is centralised in that its construction is intended to be undertaken by
FactoryOfTheFuture implementations.- Author:
- A248
-
Nested Class Summary
Nested classes/interfaces inherited from class CompletableFuture
CompletableFuture.AsynchronousCompletionTask -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) abstract CentralisedFuture<Void> acceptEitherSync(CompletionStage<? extends T> other, Consumer<? super T> action) <U> CentralisedFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CentralisedFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CentralisedFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) abstract <U> CentralisedFuture<U> applyToEitherSync(CompletionStage<? extends T> other, Function<? super T, U> fn) completeAsync(Supplier<? extends T> supplier) completeAsync(Supplier<? extends T> supplier, Executor executor) completeOnTimeout(T value, long timeout, TimeUnit unit) abstract CentralisedFuture<T> completeSync(Supplier<? extends T> supplier) copy()exceptionally(Function<Throwable, ? extends T> fn) <U> CentralisedFuture<U> handle(BiFunction<? super T, Throwable, ? extends U> fn) <U> CentralisedFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) <U> CentralisedFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) abstract <U> CentralisedFuture<U> handleSync(BiFunction<? super T, Throwable, ? extends U> fn) abstract ReactionStage<T> abstract <U> CentralisedFuture<U> runAfterBoth(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) abstract CentralisedFuture<Void> runAfterBothSync(CompletionStage<?> other, Runnable action) runAfterEither(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) abstract CentralisedFuture<Void> runAfterEitherSync(CompletionStage<?> other, Runnable action) thenAccept(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action, Executor executor) <U> CentralisedFuture<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CentralisedFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) <U> CentralisedFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) abstract <U> CentralisedFuture<Void> thenAcceptBothSync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) abstract CentralisedFuture<Void> thenAcceptSync(Consumer<? super T> action) <U> CentralisedFuture<U> <U> CentralisedFuture<U> thenApplyAsync(Function<? super T, ? extends U> fn) <U> CentralisedFuture<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) abstract <U> CentralisedFuture<U> thenApplySync(Function<? super T, ? extends U> fn) <U,V> CentralisedFuture <V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> CentralisedFuture <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> CentralisedFuture <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) abstract <U,V> CentralisedFuture <V> thenCombineSync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U> CentralisedFuture<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) <U> CentralisedFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) <U> CentralisedFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) abstract <U> CentralisedFuture<U> thenComposeSync(Function<? super T, ? extends CompletionStage<U>> fn) thenRunAsync(Runnable action) thenRunAsync(Runnable action, Executor executor) abstract CentralisedFuture<Void> thenRunSync(Runnable action) Converts to an equivalent CentralisedFuture with the same completion properties as this.whenComplete(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) abstract CentralisedFuture<T> whenCompleteSync(BiConsumer<? super T, ? super Throwable> action) Methods inherited from class CompletableFuture
allOf, anyOf, cancel, complete, completedFuture, completedStage, completeExceptionally, defaultExecutor, delayedExecutor, delayedExecutor, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, runAsync, runAsync, supplyAsync, supplyAsync, toString
-
Constructor Details
-
CentralisedFuture
public CentralisedFuture()
-
-
Method Details
-
newIncompleteFuture
- Overrides:
newIncompleteFuturein classCompletableFuture<T>
-
minimalCompletionStage
- Overrides:
minimalCompletionStagein classCompletableFuture<T>
-
thenApply
- Specified by:
thenApplyin interfaceCompletionStage<T>- Specified by:
thenApplyin interfaceReactionStage<T>- Overrides:
thenApplyin classCompletableFuture<T>
-
thenApplyAsync
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>- Specified by:
thenApplyAsyncin interfaceReactionStage<T>- Overrides:
thenApplyAsyncin classCompletableFuture<T>
-
thenApplyAsync
public <U> CentralisedFuture<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) - Specified by:
thenApplyAsyncin interfaceCompletionStage<T>- Specified by:
thenApplyAsyncin interfaceReactionStage<T>- Overrides:
thenApplyAsyncin classCompletableFuture<T>
-
thenApplySync
- Specified by:
thenApplySyncin interfaceReactionStage<T>
-
thenAccept
- Specified by:
thenAcceptin interfaceCompletionStage<T>- Specified by:
thenAcceptin interfaceReactionStage<T>- Overrides:
thenAcceptin classCompletableFuture<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>- Specified by:
thenAcceptAsyncin interfaceReactionStage<T>- Overrides:
thenAcceptAsyncin classCompletableFuture<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>- Specified by:
thenAcceptAsyncin interfaceReactionStage<T>- Overrides:
thenAcceptAsyncin classCompletableFuture<T>
-
thenAcceptSync
- Specified by:
thenAcceptSyncin interfaceReactionStage<T>
-
thenRun
- Specified by:
thenRunin interfaceCompletionStage<T>- Specified by:
thenRunin interfaceReactionStage<T>- Overrides:
thenRunin classCompletableFuture<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>- Specified by:
thenRunAsyncin interfaceReactionStage<T>- Overrides:
thenRunAsyncin classCompletableFuture<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>- Specified by:
thenRunAsyncin interfaceReactionStage<T>- Overrides:
thenRunAsyncin classCompletableFuture<T>
-
thenRunSync
- Specified by:
thenRunSyncin interfaceReactionStage<T>
-
thenCombine
public <U,V> CentralisedFuture<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombinein interfaceCompletionStage<T>- Specified by:
thenCombinein interfaceReactionStage<T>- Overrides:
thenCombinein classCompletableFuture<T>
-
thenCombineAsync
public <U,V> CentralisedFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>- Specified by:
thenCombineAsyncin interfaceReactionStage<T>- Overrides:
thenCombineAsyncin classCompletableFuture<T>
-
thenCombineAsync
public <U,V> CentralisedFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>- Specified by:
thenCombineAsyncin interfaceReactionStage<T>- Overrides:
thenCombineAsyncin classCompletableFuture<T>
-
thenCombineSync
public abstract <U,V> CentralisedFuture<V> thenCombineSync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombineSyncin interfaceReactionStage<T>
-
thenAcceptBoth
public <U> CentralisedFuture<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothin interfaceCompletionStage<T>- Specified by:
thenAcceptBothin interfaceReactionStage<T>- Overrides:
thenAcceptBothin classCompletableFuture<T>
-
thenAcceptBothAsync
public <U> CentralisedFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>- Specified by:
thenAcceptBothAsyncin interfaceReactionStage<T>- Overrides:
thenAcceptBothAsyncin classCompletableFuture<T>
-
thenAcceptBothAsync
public <U> CentralisedFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>- Specified by:
thenAcceptBothAsyncin interfaceReactionStage<T>- Overrides:
thenAcceptBothAsyncin classCompletableFuture<T>
-
thenAcceptBothSync
public abstract <U> CentralisedFuture<Void> thenAcceptBothSync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothSyncin interfaceReactionStage<T>
-
runAfterBoth
- Specified by:
runAfterBothin interfaceCompletionStage<T>- Specified by:
runAfterBothin interfaceReactionStage<T>- Overrides:
runAfterBothin classCompletableFuture<T>
-
runAfterBothAsync
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>- Specified by:
runAfterBothAsyncin interfaceReactionStage<T>- Overrides:
runAfterBothAsyncin classCompletableFuture<T>
-
runAfterBothAsync
public CentralisedFuture<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>- Specified by:
runAfterBothAsyncin interfaceReactionStage<T>- Overrides:
runAfterBothAsyncin classCompletableFuture<T>
-
runAfterBothSync
- Specified by:
runAfterBothSyncin interfaceReactionStage<T>
-
applyToEither
public <U> CentralisedFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherin interfaceCompletionStage<T>- Specified by:
applyToEitherin interfaceReactionStage<T>- Overrides:
applyToEitherin classCompletableFuture<T>
-
applyToEitherAsync
public <U> CentralisedFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>- Specified by:
applyToEitherAsyncin interfaceReactionStage<T>- Overrides:
applyToEitherAsyncin classCompletableFuture<T>
-
applyToEitherAsync
public <U> CentralisedFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>- Specified by:
applyToEitherAsyncin interfaceReactionStage<T>- Overrides:
applyToEitherAsyncin classCompletableFuture<T>
-
applyToEitherSync
public abstract <U> CentralisedFuture<U> applyToEitherSync(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherSyncin interfaceReactionStage<T>
-
acceptEither
public CentralisedFuture<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherin interfaceCompletionStage<T>- Specified by:
acceptEitherin interfaceReactionStage<T>- Overrides:
acceptEitherin classCompletableFuture<T>
-
acceptEitherAsync
public CentralisedFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>- Specified by:
acceptEitherAsyncin interfaceReactionStage<T>- Overrides:
acceptEitherAsyncin classCompletableFuture<T>
-
acceptEitherAsync
public CentralisedFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>- Specified by:
acceptEitherAsyncin interfaceReactionStage<T>- Overrides:
acceptEitherAsyncin classCompletableFuture<T>
-
acceptEitherSync
public abstract CentralisedFuture<Void> acceptEitherSync(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherSyncin interfaceReactionStage<T>
-
runAfterEither
- Specified by:
runAfterEitherin interfaceCompletionStage<T>- Specified by:
runAfterEitherin interfaceReactionStage<T>- Overrides:
runAfterEitherin classCompletableFuture<T>
-
runAfterEitherAsync
- Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>- Specified by:
runAfterEitherAsyncin interfaceReactionStage<T>- Overrides:
runAfterEitherAsyncin classCompletableFuture<T>
-
runAfterEitherAsync
public CentralisedFuture<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>- Specified by:
runAfterEitherAsyncin interfaceReactionStage<T>- Overrides:
runAfterEitherAsyncin classCompletableFuture<T>
-
runAfterEitherSync
public abstract CentralisedFuture<Void> runAfterEitherSync(CompletionStage<?> other, Runnable action) - Specified by:
runAfterEitherSyncin interfaceReactionStage<T>
-
thenCompose
- Specified by:
thenComposein interfaceCompletionStage<T>- Specified by:
thenComposein interfaceReactionStage<T>- Overrides:
thenComposein classCompletableFuture<T>
-
thenComposeAsync
public <U> CentralisedFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) - Specified by:
thenComposeAsyncin interfaceCompletionStage<T>- Specified by:
thenComposeAsyncin interfaceReactionStage<T>- Overrides:
thenComposeAsyncin classCompletableFuture<T>
-
thenComposeAsync
public <U> CentralisedFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) - Specified by:
thenComposeAsyncin interfaceCompletionStage<T>- Specified by:
thenComposeAsyncin interfaceReactionStage<T>- Overrides:
thenComposeAsyncin classCompletableFuture<T>
-
thenComposeSync
public abstract <U> CentralisedFuture<U> thenComposeSync(Function<? super T, ? extends CompletionStage<U>> fn) - Specified by:
thenComposeSyncin interfaceReactionStage<T>
-
whenComplete
- Specified by:
whenCompletein interfaceCompletionStage<T>- Specified by:
whenCompletein interfaceReactionStage<T>- Overrides:
whenCompletein classCompletableFuture<T>
-
whenCompleteAsync
- Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>- Specified by:
whenCompleteAsyncin interfaceReactionStage<T>- Overrides:
whenCompleteAsyncin classCompletableFuture<T>
-
whenCompleteAsync
public CentralisedFuture<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) - Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>- Specified by:
whenCompleteAsyncin interfaceReactionStage<T>- Overrides:
whenCompleteAsyncin classCompletableFuture<T>
-
whenCompleteSync
public abstract CentralisedFuture<T> whenCompleteSync(BiConsumer<? super T, ? super Throwable> action) - Specified by:
whenCompleteSyncin interfaceReactionStage<T>
-
handle
- Specified by:
handlein interfaceCompletionStage<T>- Specified by:
handlein interfaceReactionStage<T>- Overrides:
handlein classCompletableFuture<T>
-
handleAsync
- Specified by:
handleAsyncin interfaceCompletionStage<T>- Specified by:
handleAsyncin interfaceReactionStage<T>- Overrides:
handleAsyncin classCompletableFuture<T>
-
handleAsync
public <U> CentralisedFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) - Specified by:
handleAsyncin interfaceCompletionStage<T>- Specified by:
handleAsyncin interfaceReactionStage<T>- Overrides:
handleAsyncin classCompletableFuture<T>
-
handleSync
public abstract <U> CentralisedFuture<U> handleSync(BiFunction<? super T, Throwable, ? extends U> fn) - Specified by:
handleSyncin interfaceReactionStage<T>
-
exceptionally
- Specified by:
exceptionallyin interfaceCompletionStage<T>- Specified by:
exceptionallyin interfaceReactionStage<T>- Overrides:
exceptionallyin classCompletableFuture<T>
-
copy
- Overrides:
copyin classCompletableFuture<T>
-
completeAsync
- Overrides:
completeAsyncin classCompletableFuture<T>
-
completeAsync
- Overrides:
completeAsyncin classCompletableFuture<T>
-
completeSync
-
orTimeout
- Overrides:
orTimeoutin classCompletableFuture<T>
-
completeOnTimeout
- Overrides:
completeOnTimeoutin classCompletableFuture<T>
-
toCompletableFuture
Description copied from interface:ReactionStageConverts to an equivalent CentralisedFuture with the same completion properties as this.- Specified by:
toCompletableFuturein interfaceCompletionStage<T>- Specified by:
toCompletableFuturein interfaceReactionStage<T>- Overrides:
toCompletableFuturein classCompletableFuture<T>- Returns:
- the centralised future
-