Top Description Fields Constructors Methods
org.jooq.impl

pack-priv final Class ExecutorProviderCompletionStage<T>

extends Object
implements CompletionStage<T>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.CompletionStage
Imports
java.util.concurrent.CompletableFuture, .CompletionStage, .Executor, .ForkJoinPool, java.util.function.BiConsumer, .BiFunction, .Consumer, .Function, org.jooq.ExecutorProvider

A CompletionStage that defaults to an ExecutorProvider for all async methods that do not have an explicit Executor.

In jOOQ, the ExecutorProvider SPI is used for all types of asynchronous tasks. It overrides standard CompletableFuture behaviour in case users prefer not to use the ForkJoinPool#commonPool().

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final CompletionStage<T>
private final ExecutorProvider

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final CompletionStage<Void>
acceptEither(CompletionStage<? extends T>
the other CompletionStage
other
,
Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.acceptEither.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied action.
public final CompletionStage<Void>
acceptEitherAsync(CompletionStage<? extends T>
the other CompletionStage
other
,
Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.acceptEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the corresponding result as argument to the supplied action.
public final CompletionStage<Void>
acceptEitherAsync(CompletionStage<? extends T>
the other CompletionStage
other
,
Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.acceptEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using the supplied executor, with the corresponding result as argument to the supplied action.
public final <U> CompletionStage<U>
applyToEither(CompletionStage<? extends T>
the other CompletionStage
other
,
Function<? super T, U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.applyToEither.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied function.
public final <U> CompletionStage<U>
applyToEitherAsync(CompletionStage<? extends T>
the other CompletionStage
other
,
Function<? super T, U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.applyToEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the corresponding result as argument to the supplied function.
public final <U> CompletionStage<U>
applyToEitherAsync(CompletionStage<? extends T>
the other CompletionStage
other
,
Function<? super T, U>
the function to use to compute the value of the returned CompletionStage
fn
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.applyToEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using the supplied executor, with the corresponding result as argument to the supplied function.
public final CompletionStage<T>
exceptionally(Function<Throwable, ? extends T>
the function to use to compute the value of the returned CompletionStage if this CompletionStage completed exceptionally
fn
)

Implements java.util.concurrent.CompletionStage.exceptionally.

Returns a new CompletionStage that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied function.
public final <U> CompletionStage<U>
handle(BiFunction<? super T, Throwable, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.handle.

Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed with this stage's result and exception as arguments to the supplied function.
public final <U> CompletionStage<U>
handleAsync(BiFunction<? super T, Throwable, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.handleAsync.

Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed using this stage's default asynchronous execution facility, with this stage's result and exception as arguments to the supplied function.
public final <U> CompletionStage<U>
handleAsync(BiFunction<? super T, Throwable, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.handleAsync.

Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed using the supplied executor, with this stage's result and exception as arguments to the supplied function.
pack-priv static final <T> ExecutorProviderCompletionStage<T>
of(CompletionStage<T> delegate, ExecutorProvider provider)

public final CompletionStage<Void>
runAfterBoth(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.runAfterBoth.

Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action.
public final CompletionStage<Void>
runAfterBothAsync(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.runAfterBothAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action using this stage's default asynchronous execution facility.
public final CompletionStage<Void>
runAfterBothAsync(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.runAfterBothAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action using the supplied executor.
public final CompletionStage<Void>
runAfterEither(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.runAfterEither.

Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action.
public final CompletionStage<Void>
runAfterEitherAsync(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.runAfterEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using this stage's default asynchronous execution facility.
public final CompletionStage<Void>
runAfterEitherAsync(CompletionStage<?>
the other CompletionStage
other
,
Runnable
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.runAfterEitherAsync.

Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using the supplied executor.
public final CompletionStage<Void>
thenAccept(Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenAccept.

Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied action.
public final CompletionStage<Void>
thenAcceptAsync(Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenAcceptAsync.

Returns a new CompletionStage that, when this stage completes normally, is executed using this stage's default asynchronous execution facility, with this stage's result as the argument to the supplied action.
public final CompletionStage<Void>
thenAcceptAsync(Consumer<? super T>
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenAcceptAsync.

Returns a new CompletionStage that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied action.
public final <U> CompletionStage<Void>
thenAcceptBoth(CompletionStage<? extends U>
the other CompletionStage
other
,
BiConsumer<? super T, ? super U>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenAcceptBoth.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed with the two results as arguments to the supplied action.
public final <U> CompletionStage<Void>
thenAcceptBothAsync(CompletionStage<? extends U>
the other CompletionStage
other
,
BiConsumer<? super T, ? super U>
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenAcceptBothAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed using this stage's default asynchronous execution facility, with the two results as arguments to the supplied action.
public final <U> CompletionStage<Void>
thenAcceptBothAsync(CompletionStage<? extends U>
the other CompletionStage
other
,
BiConsumer<? super T, ? super U>
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenAcceptBothAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied action.
public final <U> CompletionStage<U>
thenApply(Function<? super T, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenApply.

Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.
public final <U> CompletionStage<U>
thenApplyAsync(Function<? super T, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenApplyAsync.

Returns a new CompletionStage that, when this stage completes normally, is executed using this stage's default asynchronous execution facility, with this stage's result as the argument to the supplied function.
public final <U> CompletionStage<U>
thenApplyAsync(Function<? super T, ? extends U>
the function to use to compute the value of the returned CompletionStage
fn
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenApplyAsync.

Returns a new CompletionStage that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied function.
public final <U, V> CompletionStage<V>
thenCombine(CompletionStage<? extends U>
the other CompletionStage
other
,
BiFunction<? super T, ? super U, ? extends V>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenCombine.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed with the two results as arguments to the supplied function.
public final <U, V> CompletionStage<V>
thenCombineAsync(CompletionStage<? extends U>
the other CompletionStage
other
,
BiFunction<? super T, ? super U, ? extends V>
the function to use to compute the value of the returned CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenCombineAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed using this stage's default asynchronous execution facility, with the two results as arguments to the supplied function.
public final <U, V> CompletionStage<V>
thenCombineAsync(CompletionStage<? extends U>
the other CompletionStage
other
,
BiFunction<? super T, ? super U, ? extends V>
the function to use to compute the value of the returned CompletionStage
fn
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenCombineAsync.

Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function.
public final <U> CompletionStage<U>
thenCompose(Function<? super T, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenCompose.

Returns a new CompletionStage that is completed with the same value as the CompletionStage returned by the given function.
public final <U> CompletionStage<U>
thenComposeAsync(Function<? super T, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage
fn
)

Implements java.util.concurrent.CompletionStage.thenComposeAsync.

Returns a new CompletionStage that is completed with the same value as the CompletionStage returned by the given function, executed using this stage's default asynchronous execution facility.
public final <U> CompletionStage<U>
thenComposeAsync(Function<? super T, ? extends CompletionStage<U>>
the function to use to compute another CompletionStage
fn
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenComposeAsync.

Returns a new CompletionStage that is completed with the same value as the CompletionStage returned by the given function, executed using the supplied Executor.
public final CompletionStage<Void>
thenRun(Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenRun.

Returns a new CompletionStage that, when this stage completes normally, executes the given action.
public final CompletionStage<Void>
thenRunAsync(Runnable
the action to perform before completing the returned CompletionStage
action
)

Implements java.util.concurrent.CompletionStage.thenRunAsync.

Returns a new CompletionStage that, when this stage completes normally, executes the given action using this stage's default asynchronous execution facility.
public final CompletionStage<Void>
thenRunAsync(Runnable
the action to perform before completing the returned CompletionStage
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.thenRunAsync.

Returns a new CompletionStage that, when this stage completes normally, executes the given action using the supplied Executor.
public final CompletableFuture<T>
toCompletableFuture()

Implements java.util.concurrent.CompletionStage.toCompletableFuture.

Returns a CompletableFuture maintaining the same completion properties as this stage.
public final CompletionStage<T>
whenComplete(BiConsumer<? super T, ? super Throwable>
the action to perform
action
)

Implements java.util.concurrent.CompletionStage.whenComplete.

Returns a new CompletionStage with the same result or exception as this stage, that executes the given action when this stage completes.
public final CompletionStage<T>
whenCompleteAsync(BiConsumer<? super T, ? super Throwable>
the action to perform
action
)

Implements java.util.concurrent.CompletionStage.whenCompleteAsync.

Returns a new CompletionStage with the same result or exception as this stage, that executes the given action using this stage's default asynchronous execution facility when this stage completes.
public final CompletionStage<T>
whenCompleteAsync(BiConsumer<? super T, ? super Throwable>
the action to perform
action
,
Executor
the executor to use for asynchronous execution
executor
)

Implements java.util.concurrent.CompletionStage.whenCompleteAsync.

Returns a new CompletionStage with the same result or exception as this stage, that executes the given action using the supplied Executor when this stage completes.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait