Interface TransactionStatus<T>

Type Parameters:
T - The native transaction type
All Superinterfaces:
io.micronaut.core.propagation.PropagatedContextElement, TransactionExecution
All Known Subinterfaces:
InternalTransaction<T>
All Known Implementing Classes:
AbstractInternalTransaction, DefaultTransactionStatus

public interface TransactionStatus<T> extends TransactionExecution, io.micronaut.core.propagation.PropagatedContextElement
The transaction status.
Since:
1.0.0
Author:
graemerocher, Denis Stepanov
  • Method Details

    • getTransaction

      @Nullable @Nullable Object getTransaction()
      Returns:
      The underlying transaction object if exists.
    • getConnection

      @NonNull default T getConnection()
      Returns:
      The associated connection.
    • getConnectionStatus

      @NonNull @NonNull ConnectionStatus<T> getConnectionStatus()
      Returns:
      The connection status.
      Since:
      4.0.0
    • registerSynchronization

      default void registerSynchronization(@NonNull @NonNull TransactionSynchronization synchronization)
      Register a new transaction synchronization for the current state.

      Note that synchronizations can implement the Ordered interface. They will be executed in an order according to their order value (if any).

      Parameters:
      synchronization - the synchronization object to register
    • propagate

      default <V> V propagate(io.micronaut.core.propagation.PropagatedContext propagatedContext, Supplier<V> supplier)
      Propagated the current PropagatedContext with added connection status.
      Type Parameters:
      V - The value type
      Parameters:
      propagatedContext - The propagated context
      supplier - The supplier
      Returns:
      The value
      Since:
      5.0
    • propagate

      default <V> V propagate(Supplier<V> supplier)
      Propagated the current PropagatedContext with added connection status.
      Type Parameters:
      V - The value type
      Parameters:
      supplier - The supplier
      Returns:
      The value
      Since:
      5.0
    • propagate

      default void propagate(Runnable runnable)
      Propagated the current PropagatedContext with added connection status.
      Parameters:
      runnable - The runnable
      Since:
      5.0