Interface ReactorReactiveTransactionOperations<C>
-
- Type Parameters:
C- The transaction connection
- All Superinterfaces:
ReactiveTransactionOperations<C>
- All Known Subinterfaces:
HibernateReactorRepositoryOperations,MongoReactorRepositoryOperations
- All Known Implementing Classes:
DefaultReactiveMongoRepositoryOperations
public interface ReactorReactiveTransactionOperations<C> extends ReactiveTransactionOperations<C>
Special version ofReactiveTransactionOperationsthat is exposing Reactor publishers.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.micronaut.transaction.reactive.ReactiveTransactionOperations
ReactiveTransactionOperations.TransactionalCallback<C,T>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRANSACTION_DEFINITION_KEY_PREFIXThe prefix of transaction definition Reactor context key.static java.lang.StringTRANSACTION_STATUS_KEY_PREFIXThe prefix of transaction status Reactor context key.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TransactionDefinitiongetTransactionDefinition(reactor.util.context.ContextView contextView)Retrieve the transaction definition associated to the current transaction from the Reactor context.ReactiveTransactionStatus<C>getTransactionStatus(reactor.util.context.ContextView contextView)Retrieve the transaction status associated to the current transaction manager from the Reactor context.default <T> reactor.core.publisher.Flux<T>withTransaction(ReactiveTransactionOperations.TransactionalCallback<C,T> handler)Execute the given handler with a new transaction.<T> reactor.core.publisher.Flux<T>withTransaction(TransactionDefinition definition, ReactiveTransactionOperations.TransactionalCallback<C,T> handler)Execute the given handler with a new transaction.default <T> reactor.core.publisher.Flux<T>withTransactionFlux(TransactionDefinition definition, java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Flux<T>> handler)Execute the given handler with a new transaction.default <T> reactor.core.publisher.Flux<T>withTransactionFlux(java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Flux<T>> handler)Execute the given handler with a new transaction.default <T> reactor.core.publisher.Mono<T>withTransactionMono(TransactionDefinition definition, java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Mono<T>> handler)Execute the given handler with a new transaction.default <T> reactor.core.publisher.Mono<T>withTransactionMono(java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Mono<T>> handler)Execute the given handler with a new transaction.
-
-
-
Field Detail
-
TRANSACTION_STATUS_KEY_PREFIX
static final java.lang.String TRANSACTION_STATUS_KEY_PREFIX
The prefix of transaction status Reactor context key.- See Also:
- Constant Field Values
-
TRANSACTION_DEFINITION_KEY_PREFIX
static final java.lang.String TRANSACTION_DEFINITION_KEY_PREFIX
The prefix of transaction definition Reactor context key.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransactionStatus
@Nullable ReactiveTransactionStatus<C> getTransactionStatus(@NonNull reactor.util.context.ContextView contextView)
Retrieve the transaction status associated to the current transaction manager from the Reactor context.- Parameters:
contextView- The context view- Returns:
- the key
-
getTransactionDefinition
@Nullable TransactionDefinition getTransactionDefinition(@NonNull reactor.util.context.ContextView contextView)
Retrieve the transaction definition associated to the current transaction from the Reactor context.- Parameters:
contextView- The context view- Returns:
- the key
-
withTransactionFlux
default <T> reactor.core.publisher.Flux<T> withTransactionFlux(@NonNull TransactionDefinition definition, @NonNull java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Flux<T>> handler)Execute the given handler with a new transaction.- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-
withTransactionFlux
default <T> reactor.core.publisher.Flux<T> withTransactionFlux(@NonNull java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Flux<T>> handler)Execute the given handler with a new transaction.- Type Parameters:
T- The emitted type- Parameters:
handler- The handler- Returns:
- A publisher that emits the result type
-
withTransactionMono
default <T> reactor.core.publisher.Mono<T> withTransactionMono(@NonNull TransactionDefinition definition, @NonNull java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Mono<T>> handler)Execute the given handler with a new transaction.- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-
withTransactionMono
default <T> reactor.core.publisher.Mono<T> withTransactionMono(@NonNull java.util.function.Function<ReactiveTransactionStatus<C>,reactor.core.publisher.Mono<T>> handler)Execute the given handler with a new transaction.- Type Parameters:
T- The emitted type- Parameters:
handler- The handler- Returns:
- A publisher that emits the result type
-
withTransaction
@NonNull <T> reactor.core.publisher.Flux<T> withTransaction(@NonNull TransactionDefinition definition, @NonNull ReactiveTransactionOperations.TransactionalCallback<C,T> handler)Description copied from interface:ReactiveTransactionOperationsExecute the given handler with a new transaction.- Specified by:
withTransactionin interfaceReactiveTransactionOperations<C>- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-
withTransaction
@NonNull default <T> reactor.core.publisher.Flux<T> withTransaction(@NonNull ReactiveTransactionOperations.TransactionalCallback<C,T> handler)Description copied from interface:ReactiveTransactionOperationsExecute the given handler with a new transaction.- Specified by:
withTransactionin interfaceReactiveTransactionOperations<C>- Type Parameters:
T- The emitted type- Parameters:
handler- The handler- Returns:
- A publisher that emits the result type
-
-