Interface ConnectionStatus<C>

Type Parameters:
C - The connection type
All Superinterfaces:
io.micronaut.core.propagation.PropagatedContextElement
All Known Subinterfaces:
ReactiveConnectionStatus<C>
All Known Implementing Classes:
DefaultConnectionStatus, DefaultReactiveConnectionStatus

public interface ConnectionStatus<C> extends io.micronaut.core.propagation.PropagatedContextElement
The connection status.
Since:
4.0.0
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    The connection representation.
    The connection definition.
    boolean
    A new connection value.
    default <V> V
    propagate(io.micronaut.core.propagation.PropagatedContext propagatedContext, Supplier<V> supplier)
    Propagated the current PropagatedContext with added connection status.
    default void
    propagate(Runnable runnable)
    Propagated the current PropagatedContext with added connection status.
    default <V> V
    propagate(Supplier<V> supplier)
    Propagated the current PropagatedContext with added connection status.
    void
    Register connection synchronization.
  • Method Details

    • isNew

      boolean isNew()
      A new connection value. Based on the propagation value the connection manager might decide to reuse the existing connection.
      Returns:
      true if the connection is new
    • getConnection

      @NonNull C getConnection()
      The connection representation.
      Returns:
      The connection representation
    • getDefinition

      @NonNull @NonNull ConnectionDefinition getDefinition()
      The connection definition.
      Returns:
      The connection definition
    • registerSynchronization

      void registerSynchronization(@NonNull @NonNull ConnectionSynchronization synchronization)
      Register connection synchronization.
      Parameters:
      synchronization - The synchronization
    • 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