Class ReactorPropagation

java.lang.Object
io.micronaut.core.async.propagation.ReactorPropagation

public final class ReactorPropagation extends Object
Reactor propagation of PropagatedContext.
Since:
4.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key to be used in the Reactor context.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NonNull reactor.util.context.Context
    addContextElement(@NonNull reactor.util.context.Context context, @NonNull io.micronaut.core.propagation.PropagatedContextElement contextElement)
    Adds a context element to the Reactor's context.
    static @NonNull reactor.util.context.Context
    addPropagatedContext(@NonNull reactor.util.context.Context context, @NonNull io.micronaut.core.propagation.PropagatedContext propagatedContext)
    Adds propagated context to the Reactors' context.
    static <E extends io.micronaut.core.propagation.PropagatedContextElement>
    Stream<E>
    findAllContextElements(@NonNull reactor.util.context.ContextView contextView, @NonNull Class<E> contextElementType)
    Finds all context elements by the type.
    static <E extends io.micronaut.core.propagation.PropagatedContextElement>
    Optional<E>
    findContextElement(@NonNull reactor.util.context.ContextView contextView, @NonNull Class<E> contextElementType)
    Finds the context element by the type.
    static Optional<io.micronaut.core.propagation.PropagatedContext>
    findPropagatedContext(@NonNull reactor.util.context.ContextView contextView)
    Finds propagated context in the Reactor's context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROPAGATED_CONTEXT_REACTOR_CONTEXT_VIEW_KEY

      public static final String PROPAGATED_CONTEXT_REACTOR_CONTEXT_VIEW_KEY
      The key to be used in the Reactor context.
      See Also:
  • Method Details

    • addPropagatedContext

      @NonNull public static @NonNull reactor.util.context.Context addPropagatedContext(@NonNull @NonNull reactor.util.context.Context context, @NonNull @NonNull io.micronaut.core.propagation.PropagatedContext propagatedContext)
      Adds propagated context to the Reactors' context.
      Parameters:
      context - The context to be extended
      propagatedContext - The propagated context
      Returns:
      The modified context
    • addContextElement

      @NonNull public static @NonNull reactor.util.context.Context addContextElement(@NonNull @NonNull reactor.util.context.Context context, @NonNull @NonNull io.micronaut.core.propagation.PropagatedContextElement contextElement)
      Adds a context element to the Reactor's context.
      Parameters:
      context - The context to be extended
      contextElement - The propagated context element
      Returns:
      The modified context
    • findContextElement

      public static <E extends io.micronaut.core.propagation.PropagatedContextElement> Optional<E> findContextElement(@NonNull @NonNull reactor.util.context.ContextView contextView, @NonNull @NonNull Class<E> contextElementType)
      Finds the context element by the type.
      Type Parameters:
      E - The element type
      Parameters:
      contextView - The Reactor's context
      contextElementType - The element type
      Returns:
      optional context element
    • findAllContextElements

      public static <E extends io.micronaut.core.propagation.PropagatedContextElement> Stream<E> findAllContextElements(@NonNull @NonNull reactor.util.context.ContextView contextView, @NonNull @NonNull Class<E> contextElementType)
      Finds all context elements by the type.
      Type Parameters:
      E - All elements if the type
      Parameters:
      contextView - The Reactor's context
      contextElementType - The element type
      Returns:
      optional context element
    • findPropagatedContext

      public static Optional<io.micronaut.core.propagation.PropagatedContext> findPropagatedContext(@NonNull @NonNull reactor.util.context.ContextView contextView)
      Finds propagated context in the Reactor's context.
      Parameters:
      contextView - The context
      Returns:
      optional propagated context