Class CoroutineTxHelper
- java.lang.Object
-
- io.micronaut.transaction.interceptor.CoroutineTxHelper
-
@Internal @Singleton @Requires(classes=kotlin.coroutines.CoroutineContext.class) public final class CoroutineTxHelper extends java.lang.Object
Helper to setup Kotlin coroutine context.- Since:
- 3.3
- Author:
- Denis Stepanov
-
-
Constructor Summary
Constructors Constructor Description CoroutineTxHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransactionSynchronizationManager.TransactionSynchronizationState
getTxState(io.micronaut.aop.kotlin.KotlinInterceptedMethod kotlinInterceptedMethod)
Find the TX state.void
setupTxState(io.micronaut.aop.kotlin.KotlinInterceptedMethod kotlinInterceptedMethod, TransactionSynchronizationManager.TransactionSynchronizationState state)
Extract the TX state from the Kotlin's context or takes the thread-local context.
-
-
-
Method Detail
-
setupTxState
public void setupTxState(io.micronaut.aop.kotlin.KotlinInterceptedMethod kotlinInterceptedMethod, TransactionSynchronizationManager.TransactionSynchronizationState state)
Extract the TX state from the Kotlin's context or takes the thread-local context.- Parameters:
state
- The transaction statekotlinInterceptedMethod
- The intercepted method
-
getTxState
@Nullable public TransactionSynchronizationManager.TransactionSynchronizationState getTxState(@NonNull io.micronaut.aop.kotlin.KotlinInterceptedMethod kotlinInterceptedMethod)
Find the TX state.- Parameters:
kotlinInterceptedMethod
- The intercepted method- Returns:
- the state
-
-