Package org.jdbi.v3.core.async
Class JdbiExecutorImpl
- java.lang.Object
-
- org.jdbi.v3.core.async.AbstractJdbiExecutor
-
- org.jdbi.v3.core.async.JdbiExecutorImpl
-
- All Implemented Interfaces:
JdbiExecutor
@Beta class JdbiExecutorImpl extends AbstractJdbiExecutor
-
-
Constructor Summary
Constructors Constructor Description JdbiExecutorImpl(Jdbi jdbi, java.util.concurrent.Executor executor)Construct aJdbiExecutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> java.util.concurrent.CompletionStage<T>withExecute(CheckedFunction<Jdbi,T> callback)Make sure to run the callback in a thread supplied by the executor-
Methods inherited from class org.jdbi.v3.core.async.AbstractJdbiExecutor
inTransaction, inTransaction, useExecute, useExtension, useHandle, useTransaction, useTransaction, withExtension, withHandle
-
-
-
-
Field Detail
-
jdbi
private final Jdbi jdbi
-
executor
private final java.util.concurrent.Executor executor
-
-
Constructor Detail
-
JdbiExecutorImpl
JdbiExecutorImpl(Jdbi jdbi, java.util.concurrent.Executor executor)
Construct aJdbiExecutor.- Parameters:
jdbi- the initialized Jdbi classexecutor- an executor to use for all database calls
-
-
Method Detail
-
withExecute
protected <T> java.util.concurrent.CompletionStage<T> withExecute(CheckedFunction<Jdbi,T> callback)
Make sure to run the callback in a thread supplied by the executor- Specified by:
withExecutein classAbstractJdbiExecutor- Type Parameters:
T- type returned by the callback- Parameters:
callback- the callback that takes a Jdbi instance and returns a value- Returns:
- a completion stage that will complete when the callback returns a value or throws an exception
-
-