Class IgniteClientFutureImpl<T>
- java.lang.Object
-
- org.apache.ignite.internal.client.thin.IgniteClientFutureImpl<T>
-
- Type Parameters:
T- Result type.
- All Implemented Interfaces:
CompletionStage<T>,Future<T>,IgniteClientFuture<T>
public class IgniteClientFutureImpl<T> extends Object implements IgniteClientFuture<T>
Ignite thin client future - a wrapper aroundCompletableFuture.
-
-
Constructor Summary
Constructors Constructor Description IgniteClientFutureImpl(CompletableFuture<T> fut, Function<Boolean,Boolean> onCancel)Ctor.IgniteClientFutureImpl(CompletionStage<T> fut)Ctor.
-
Method Summary
-
-
-
Constructor Detail
-
IgniteClientFutureImpl
public IgniteClientFutureImpl(CompletableFuture<T> fut, Function<Boolean,Boolean> onCancel)
Ctor.- Parameters:
fut- Future to wrap.
-
IgniteClientFutureImpl
public IgniteClientFutureImpl(CompletionStage<T> fut)
Ctor.- Parameters:
fut- Future to wrap.
-
-
Method Detail
-
completedFuture
public static <T> IgniteClientFutureImpl<T> completedFuture(T res)
Gets a completed future with the given result.- Type Parameters:
T- Result type.- Parameters:
res- Result to wrap in a future.- Returns:
- Completed future.
-
get
public T get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
thenApply
public <U> CompletableFuture<U> thenApply(Function<? super T,? extends U> function)
- Specified by:
thenApplyin interfaceCompletionStage<T>
-
thenApplyAsync
public <U> CompletableFuture<U> thenApplyAsync(Function<? super T,? extends U> function)
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenApplyAsync
public <U> CompletableFuture<U> thenApplyAsync(Function<? super T,? extends U> function, Executor executor)
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenAccept
public CompletableFuture<Void> thenAccept(Consumer<? super T> consumer)
- Specified by:
thenAcceptin interfaceCompletionStage<T>
-
thenAcceptAsync
public CompletableFuture<Void> thenAcceptAsync(Consumer<? super T> consumer)
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenAcceptAsync
public CompletableFuture<Void> thenAcceptAsync(Consumer<? super T> consumer, Executor executor)
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenRun
public CompletableFuture<Void> thenRun(Runnable runnable)
- Specified by:
thenRunin interfaceCompletionStage<T>
-
thenRunAsync
public CompletableFuture<Void> thenRunAsync(Runnable runnable)
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenRunAsync
public CompletableFuture<Void> thenRunAsync(Runnable runnable, Executor executor)
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenCombine
public <U,V> CompletableFuture<V> thenCombine(CompletionStage<? extends U> completionStage, BiFunction<? super T,? super U,? extends V> biFunction)
- Specified by:
thenCombinein interfaceCompletionStage<T>
-
thenCombineAsync
public <U,V> CompletableFuture<V> thenCombineAsync(CompletionStage<? extends U> completionStage, BiFunction<? super T,? super U,? extends V> biFunction)
- Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenCombineAsync
public <U,V> CompletableFuture<V> thenCombineAsync(CompletionStage<? extends U> completionStage, BiFunction<? super T,? super U,? extends V> biFunction, Executor executor)
- Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenAcceptBoth
public <U> CompletableFuture<Void> thenAcceptBoth(CompletionStage<? extends U> completionStage, BiConsumer<? super T,? super U> biConsumer)
- Specified by:
thenAcceptBothin interfaceCompletionStage<T>
-
thenAcceptBothAsync
public <U> CompletableFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> completionStage, BiConsumer<? super T,? super U> biConsumer)
- Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
thenAcceptBothAsync
public <U> CompletableFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> completionStage, BiConsumer<? super T,? super U> biConsumer, Executor executor)
- Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
runAfterBoth
public CompletableFuture<Void> runAfterBoth(CompletionStage<?> completionStage, Runnable runnable)
- Specified by:
runAfterBothin interfaceCompletionStage<T>
-
runAfterBothAsync
public CompletableFuture<Void> runAfterBothAsync(CompletionStage<?> completionStage, Runnable runnable)
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
runAfterBothAsync
public CompletableFuture<Void> runAfterBothAsync(CompletionStage<?> completionStage, Runnable runnable, Executor executor)
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
applyToEither
public <U> CompletableFuture<U> applyToEither(CompletionStage<? extends T> completionStage, Function<? super T,U> function)
- Specified by:
applyToEitherin interfaceCompletionStage<T>
-
applyToEitherAsync
public <U> CompletableFuture<U> applyToEitherAsync(CompletionStage<? extends T> completionStage, Function<? super T,U> function)
- Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
applyToEitherAsync
public <U> CompletableFuture<U> applyToEitherAsync(CompletionStage<? extends T> completionStage, Function<? super T,U> function, Executor executor)
- Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
acceptEither
public CompletableFuture<Void> acceptEither(CompletionStage<? extends T> completionStage, Consumer<? super T> consumer)
- Specified by:
acceptEitherin interfaceCompletionStage<T>
-
acceptEitherAsync
public CompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> completionStage, Consumer<? super T> consumer)
- Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
acceptEitherAsync
public CompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> completionStage, Consumer<? super T> consumer, Executor executor)
- Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
runAfterEither
public CompletableFuture<Void> runAfterEither(CompletionStage<?> completionStage, Runnable runnable)
- Specified by:
runAfterEitherin interfaceCompletionStage<T>
-
runAfterEitherAsync
public CompletableFuture<Void> runAfterEitherAsync(CompletionStage<?> completionStage, Runnable runnable)
- Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
runAfterEitherAsync
public CompletableFuture<Void> runAfterEitherAsync(CompletionStage<?> completionStage, Runnable runnable, Executor executor)
- Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
thenCompose
public <U> CompletableFuture<U> thenCompose(Function<? super T,? extends CompletionStage<U>> function)
- Specified by:
thenComposein interfaceCompletionStage<T>
-
thenComposeAsync
public <U> CompletableFuture<U> thenComposeAsync(Function<? super T,? extends CompletionStage<U>> function)
- Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
thenComposeAsync
public <U> CompletableFuture<U> thenComposeAsync(Function<? super T,? extends CompletionStage<U>> function, Executor executor)
- Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
whenComplete
public CompletableFuture<T> whenComplete(BiConsumer<? super T,? super Throwable> biConsumer)
- Specified by:
whenCompletein interfaceCompletionStage<T>
-
whenCompleteAsync
public CompletableFuture<T> whenCompleteAsync(BiConsumer<? super T,? super Throwable> biConsumer)
- Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
whenCompleteAsync
public CompletableFuture<T> whenCompleteAsync(BiConsumer<? super T,? super Throwable> biConsumer, Executor executor)
- Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
handle
public <U> CompletableFuture<U> handle(BiFunction<? super T,Throwable,? extends U> biFunction)
- Specified by:
handlein interfaceCompletionStage<T>
-
handleAsync
public <U> CompletableFuture<U> handleAsync(BiFunction<? super T,Throwable,? extends U> biFunction)
- Specified by:
handleAsyncin interfaceCompletionStage<T>
-
handleAsync
public <U> CompletableFuture<U> handleAsync(BiFunction<? super T,Throwable,? extends U> biFunction, Executor executor)
- Specified by:
handleAsyncin interfaceCompletionStage<T>
-
toCompletableFuture
public CompletableFuture<T> toCompletableFuture()
- Specified by:
toCompletableFuturein interfaceCompletionStage<T>
-
exceptionally
public CompletableFuture<T> exceptionally(Function<Throwable,? extends T> function)
- Specified by:
exceptionallyin interfaceCompletionStage<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<T>
-
-