This commit is contained in:
parent
e8e383317f
commit
b422ec0153
@ -77,7 +77,6 @@ import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
@ -220,12 +219,15 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
|
||||
|
||||
/**
|
||||
* Run a {@link TransactionalCallable} in the context of this
|
||||
* Run a {@link TransactionalCallable} asynchronously.
|
||||
* <p>
|
||||
* The <code>TransactionCallable</code> is run in the context of this
|
||||
* <code>DSLContext</code>'s underlying {@link #configuration()}'s
|
||||
* {@link Configuration#transactionProvider()}, and return the
|
||||
* {@link Configuration#transactionProvider()}, and returns the
|
||||
* <code>transactional</code>'s outcome in a new {@link CompletionStage}
|
||||
* that is asynchronously completed by a task running in the
|
||||
* {@link ForkJoinPool#commonPool()}.
|
||||
* that is asynchronously completed by a task run by an {@link Executor}
|
||||
* provided by the underlying {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @param transactional The transactional code
|
||||
* @return The transactional outcome
|
||||
@ -233,23 +235,29 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
<T> CompletionStage<T> transactionResultAsync(TransactionalCallable<T> transactional);
|
||||
|
||||
/**
|
||||
* Run a {@link TransactionalRunnable} in the context of this
|
||||
* Run a {@link TransactionalRunnable} asynchronously.
|
||||
* <p>
|
||||
* The <code>TransactionRunnable</code> is run in the context of this
|
||||
* <code>DSLContext</code>'s underlying {@link #configuration()}'s
|
||||
* {@link Configuration#transactionProvider()}, and return the
|
||||
* {@link Configuration#transactionProvider()}, and returns the
|
||||
* <code>transactional</code>'s outcome in a new {@link CompletionStage}
|
||||
* that is asynchronously completed by a task running in the
|
||||
* {@link ForkJoinPool#commonPool()}.
|
||||
* that is asynchronously completed by a task run by an {@link Executor}
|
||||
* provided by the underlying {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @param transactional The transactional code
|
||||
*/
|
||||
CompletionStage<Void> transactionAsync(TransactionalRunnable transactional);
|
||||
|
||||
/**
|
||||
* Run a {@link TransactionalCallable} in the context of this
|
||||
* Run a {@link TransactionalCallable} asynchronously.
|
||||
* <p>
|
||||
* The <code>TransactionCallable</code> is run in the context of this
|
||||
* <code>DSLContext</code>'s underlying {@link #configuration()}'s
|
||||
* {@link Configuration#transactionProvider()}, and return the
|
||||
* {@link Configuration#transactionProvider()}, and returns the
|
||||
* <code>transactional</code>'s outcome in a new {@link CompletionStage}
|
||||
* that is asynchronously completed by a task running in the given executor.
|
||||
* that is asynchronously completed by a task run by a given
|
||||
* {@link Executor}.
|
||||
*
|
||||
* @param transactional The transactional code
|
||||
* @return The transactional outcome
|
||||
@ -257,11 +265,14 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
<T> CompletionStage<T> transactionResultAsync(Executor executor, TransactionalCallable<T> transactional);
|
||||
|
||||
/**
|
||||
* Run a {@link TransactionalRunnable} in the context of this
|
||||
* Run a {@link TransactionalRunnable} asynchronously.
|
||||
* <p>
|
||||
* The <code>TransactionRunnable</code> is run in the context of this
|
||||
* <code>DSLContext</code>'s underlying {@link #configuration()}'s
|
||||
* {@link Configuration#transactionProvider()}, and return the
|
||||
* {@link Configuration#transactionProvider()}, and returns the
|
||||
* <code>transactional</code>'s outcome in a new {@link CompletionStage}
|
||||
* that is asynchronously completed by a task running in the given executor.
|
||||
* that is asynchronously completed by a task run by a given
|
||||
* {@link Executor}.
|
||||
*
|
||||
* @param transactional The transactional code
|
||||
*/
|
||||
@ -818,8 +829,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* Example (Postgres):
|
||||
* <p>
|
||||
@ -845,8 +859,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(SQL sql);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* Example (Postgres):
|
||||
* <p>
|
||||
@ -872,8 +889,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(String sql);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* There must be as many bind variables contained in the SQL, as passed in
|
||||
* the bindings parameter
|
||||
@ -903,8 +923,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(String sql, Object... bindings);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* Unlike {@link #fetchLazy(String, Object...)}, the SQL passed to this
|
||||
* method should not contain any bind variables. Instead, you can pass
|
||||
@ -2685,8 +2708,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @param rs The JDBC ResultSet to fetch data from
|
||||
* @return The completion stage. The completed result will never be
|
||||
@ -2696,8 +2722,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(ResultSet rs);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* The additional <code>fields</code> argument is used by jOOQ to coerce
|
||||
* field names and data types to the desired output
|
||||
@ -2711,8 +2740,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(ResultSet rs, Field<?>... fields);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* The additional <code>types</code> argument is used by jOOQ to coerce data
|
||||
* types to the desired output
|
||||
@ -2726,8 +2758,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
CompletionStage<Result<Record>> fetchAsync(ResultSet rs, DataType<?>... types);
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
* <p>
|
||||
* The additional <code>types</code> argument is used by jOOQ to coerce data
|
||||
* types to the desired output
|
||||
@ -8256,8 +8291,11 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the {@link #configuration()}'s
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @param query The query to execute
|
||||
* @return The completion stage. The completed result will never be
|
||||
|
||||
@ -47,7 +47,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
|
||||
import org.jooq.conf.ParamType;
|
||||
import org.jooq.conf.Settings;
|
||||
@ -83,18 +82,21 @@ public interface Query extends QueryPart, Attachable , AutoCloseable {
|
||||
|
||||
|
||||
/**
|
||||
* Execute the query in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Execute the query in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the underlying
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @return A result value, depending on the concrete implementation of
|
||||
* {@link Query}:
|
||||
* <ul>
|
||||
* <li> {@link Delete} : the number of deleted records</li>
|
||||
* <li> {@link Insert} : the number of inserted records</li>
|
||||
* <li> {@link Merge} : the result may have no meaning</li>
|
||||
* <li> {@link Select} : the number of resulting records</li>
|
||||
* <li> {@link Truncate} : the result may have no meaning</li>
|
||||
* <li> {@link Update} : the number of updated records</li>
|
||||
* <li>{@link Delete} : the number of deleted records</li>
|
||||
* <li>{@link Insert} : the number of inserted records</li>
|
||||
* <li>{@link Merge} : the result may have no meaning</li>
|
||||
* <li>{@link Select} : the number of resulting records</li>
|
||||
* <li>{@link Truncate} : the result may have no meaning</li>
|
||||
* <li>{@link Update} : the number of updated records</li>
|
||||
* </ul>
|
||||
*/
|
||||
CompletionStage<Integer> executeAsync();
|
||||
|
||||
@ -53,7 +53,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
@ -3080,9 +3079,13 @@ public interface ResultQuery<R extends Record> extends Query, Iterable<R> {
|
||||
<E> List<E> fetch(RecordMapper<? super R, E> mapper) throws DataAccessException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fetch results in a new {@link CompletionStage} that is asynchronously
|
||||
* completed by a task running in the {@link ForkJoinPool#commonPool()}.
|
||||
* Fetch results in a new {@link CompletionStage}.
|
||||
* <p>
|
||||
* The result is asynchronously completed by a task running in an
|
||||
* {@link Executor} provided by the underlying
|
||||
* {@link Configuration#executorProvider()}.
|
||||
*
|
||||
* @return The completion stage. The completed result will never be
|
||||
* <code>null</code>.
|
||||
@ -3099,6 +3102,7 @@ public interface ResultQuery<R extends Record> extends Query, Iterable<R> {
|
||||
CompletionStage<Result<R>> fetchAsync(Executor executor);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fetch results asynchronously.
|
||||
* <p>
|
||||
|
||||
@ -394,7 +394,7 @@ abstract class AbstractQuery extends AbstractQueryPart implements Query, Attacha
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Integer> executeAsync(Executor executor) {
|
||||
return CompletableFuture.supplyAsync(blocking(this::execute), executor);
|
||||
return ExecutorProviderCompletionStage.of(CompletableFuture.supplyAsync(blocking(this::execute), executor), () -> executor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -48,8 +48,8 @@ import static java.util.concurrent.Executors.newSingleThreadExecutor;
|
||||
import static org.jooq.SQLDialect.CUBRID;
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
import static org.jooq.impl.Utils.consumeResultSets;
|
||||
import static org.jooq.impl.Utils.blocking;
|
||||
import static org.jooq.impl.Utils.consumeResultSets;
|
||||
import static org.jooq.impl.Utils.DataKey.DATA_LOCK_ROWS_FOR_UPDATE;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
@ -332,7 +332,7 @@ abstract class AbstractResultQuery<R extends Record> extends AbstractQuery imple
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Result<R>> fetchAsync(Executor executor) {
|
||||
return CompletableFuture.supplyAsync(blocking(this::fetch), executor);
|
||||
return ExecutorProviderCompletionStage.of(CompletableFuture.supplyAsync(blocking(this::fetch), executor), () -> executor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -410,7 +410,16 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
|
||||
@Override
|
||||
public CompletionStage<Void> transactionAsync(Executor executor, TransactionalRunnable transactional) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> { transaction(transactional); return null; }), executor);
|
||||
return ExecutorProviderCompletionStage.of(CompletableFuture.supplyAsync(
|
||||
blocking(
|
||||
() -> {
|
||||
transaction(transactional);
|
||||
return null;
|
||||
}),
|
||||
executor
|
||||
),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -420,7 +429,10 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
|
||||
@Override
|
||||
public <T> CompletionStage<T> transactionResultAsync(Executor executor, TransactionalCallable<T> transactional) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> transactionResult(transactional)), executor);
|
||||
return ExecutorProviderCompletionStage.of(CompletableFuture.supplyAsync(
|
||||
blocking(() -> transactionResult(transactional)), executor),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1053,22 +1065,34 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
|
||||
@Override
|
||||
public CompletionStage<Result<Record>> fetchAsync(Executor executor, ResultSet rs) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> fetch(rs)), executor);
|
||||
return ExecutorProviderCompletionStage.of(
|
||||
CompletableFuture.supplyAsync(blocking(() -> fetch(rs)), executor),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletionStage<Result<Record>> fetchAsync(Executor executor, ResultSet rs, Field<?>... fields) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> fetch(rs, fields)), executor);
|
||||
return ExecutorProviderCompletionStage.of(
|
||||
CompletableFuture.supplyAsync(blocking(() -> fetch(rs, fields)), executor),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletionStage<Result<Record>> fetchAsync(Executor executor, ResultSet rs, DataType<?>... types) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> fetch(rs, types)), executor);
|
||||
return ExecutorProviderCompletionStage.of(
|
||||
CompletableFuture.supplyAsync(blocking(() -> fetch(rs, types)), executor),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletionStage<Result<Record>> fetchAsync(Executor executor, ResultSet rs, Class<?>... types) {
|
||||
return CompletableFuture.supplyAsync(blocking(() -> fetch(rs, types)), executor);
|
||||
return ExecutorProviderCompletionStage.of(
|
||||
CompletableFuture.supplyAsync(blocking(() -> fetch(rs, types)), executor),
|
||||
() -> executor
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,268 @@
|
||||
/**
|
||||
* Copyright (c) 2009-2016, Data Geekery GmbH (http://www.datageekery.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Other licenses:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Commercial licenses for this work are available. These replace the above
|
||||
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
|
||||
* database integrations.
|
||||
*
|
||||
* For more information, please visit: http://www.jooq.org/licenses
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.jooq.ExecutorProvider;
|
||||
|
||||
/**
|
||||
* A {@link CompletionStage} that defaults to an {@link ExecutorProvider} for
|
||||
* all async methods that do not have an explicit {@link Executor}.
|
||||
* <p>
|
||||
* In jOOQ, the {@link ExecutorProvider} SPI is used for all types of
|
||||
* asynchronous tasks. It overrides standard {@link CompletableFuture} behaviour
|
||||
* in case users prefer not to use the {@link ForkJoinPool#commonPool()}.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
final class ExecutorProviderCompletionStage<T> implements CompletionStage<T> {
|
||||
|
||||
private final CompletionStage<T> delegate;
|
||||
private final ExecutorProvider provider;
|
||||
|
||||
static final <T> ExecutorProviderCompletionStage<T> of(CompletionStage<T> delegate, ExecutorProvider provider) {
|
||||
return new ExecutorProviderCompletionStage<>(delegate, provider);
|
||||
}
|
||||
|
||||
ExecutorProviderCompletionStage(CompletionStage<T> delegate, ExecutorProvider provider) {
|
||||
this.delegate = delegate;
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenApply(Function<? super T, ? extends U> fn) {
|
||||
return of(delegate.thenApply(fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn) {
|
||||
return of(delegate.thenApplyAsync(fn, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) {
|
||||
return of(delegate.thenApplyAsync(fn, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenAccept(Consumer<? super T> action) {
|
||||
return of(delegate.thenAccept(action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action) {
|
||||
return of(delegate.thenAcceptAsync(action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor) {
|
||||
return of(delegate.thenAcceptAsync(action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenRun(Runnable action) {
|
||||
return of(delegate.thenRun(action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenRunAsync(Runnable action) {
|
||||
return of(delegate.thenRunAsync(action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> thenRunAsync(Runnable action, Executor executor) {
|
||||
return of(delegate.thenRunAsync(action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U, V> CompletionStage<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) {
|
||||
return of(delegate.thenCombine(other, fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) {
|
||||
return of(delegate.thenCombineAsync(other, fn, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U, V> CompletionStage<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) {
|
||||
return of(delegate.thenCombineAsync(other, fn, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) {
|
||||
return of(delegate.thenAcceptBoth(other, action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) {
|
||||
return of(delegate.thenAcceptBothAsync(other, action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) {
|
||||
return of(delegate.thenAcceptBothAsync(other, action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterBoth(CompletionStage<?> other, Runnable action) {
|
||||
return of(delegate.runAfterBoth(other, action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action) {
|
||||
return of(delegate.runAfterBothAsync(other, action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) {
|
||||
return of(delegate.runAfterBothAsync(other, action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) {
|
||||
return of(delegate.applyToEither(other, fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) {
|
||||
return of(delegate.applyToEitherAsync(other, fn, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) {
|
||||
return of(delegate.applyToEitherAsync(other, fn, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) {
|
||||
return of(delegate.acceptEither(other, action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) {
|
||||
return of(delegate.acceptEitherAsync(other, action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) {
|
||||
return of(delegate.acceptEitherAsync(other, action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterEither(CompletionStage<?> other, Runnable action) {
|
||||
return of(delegate.runAfterEither(other, action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action) {
|
||||
return of(delegate.runAfterEitherAsync(other, action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) {
|
||||
return of(delegate.runAfterEitherAsync(other, action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) {
|
||||
return of(delegate.thenCompose(fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) {
|
||||
return of(delegate.thenComposeAsync(fn, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn,
|
||||
Executor executor) {
|
||||
return of(delegate.thenComposeAsync(fn, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<T> exceptionally(Function<Throwable, ? extends T> fn) {
|
||||
return of(delegate.exceptionally(fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<T> whenComplete(BiConsumer<? super T, ? super Throwable> action) {
|
||||
return of(delegate.whenComplete(action), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) {
|
||||
return of(delegate.whenCompleteAsync(action, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletionStage<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) {
|
||||
return of(delegate.whenCompleteAsync(action, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> handle(BiFunction<? super T, Throwable, ? extends U> fn) {
|
||||
return of(delegate.handle(fn), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) {
|
||||
return of(delegate.handleAsync(fn, provider.provide()), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <U> CompletionStage<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) {
|
||||
return of(delegate.handleAsync(fn, executor), provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CompletableFuture<T> toCompletableFuture() {
|
||||
return delegate.toCompletableFuture();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user