Package org.axonframework.common.jdbc
Class ConnectionExecutor
java.lang.Object
org.axonframework.common.jdbc.ConnectionExecutor
- All Implemented Interfaces:
TransactionalExecutor<Connection>
@Internal
public class ConnectionExecutor
extends Object
implements TransactionalExecutor<Connection>
A
TransactionalExecutor implementation for JDBC Connections.- Since:
- 5.0.2
- Author:
- John Hendrikx
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> CompletableFuture<R> apply(ThrowingFunction<Connection, R, Exception> function) Executes a transactional operation that returns a result.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.common.tx.TransactionalExecutor
accept
-
Constructor Details
-
ConnectionExecutor
Creates a new instance.- Parameters:
provider- AConnectionProvider, cannot benull.- Throws:
NullPointerException- If any argument isnull.
-
-
Method Details
-
apply
Description copied from interface:TransactionalExecutorExecutes a transactional operation that returns a result.Implementations are responsible for managing the lifecycle of the provided resource, including obtaining, closing, commit and rollback.
- Specified by:
applyin interfaceTransactionalExecutor<Connection>- Type Parameters:
R- The type of the result returned by the function.- Parameters:
function- A function that accepts the transactional resource of typeTand produces a result of typeR; cannot benull.- Returns:
- A
CompletableFuturewhich when it completes contains the result of the provided function, nevernull.
-