Class ReactorPropagation
java.lang.Object
io.micronaut.core.async.propagation.ReactorPropagation
Reactor propagation of
PropagatedContext
.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull reactor.util.context.Context
addContextElement
(@NonNull reactor.util.context.Context context, @NonNull 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 PropagatedContext propagatedContext) Adds propagated context to the Reactors' context.static <E extends PropagatedContextElement>
Stream<E>findAllContextElements
(@NonNull reactor.util.context.ContextView contextView, @NonNull Class<E> contextElementType) Finds all context elements by the type.static <E extends PropagatedContextElement>
Optional<E>findContextElement
(@NonNull reactor.util.context.ContextView contextView, @NonNull Class<E> contextElementType) Finds the context element by the type.static Optional<PropagatedContext>
findPropagatedContext
(@NonNull reactor.util.context.ContextView contextView) Finds propagated context in the Reactor's context.
-
Field Details
-
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 PropagatedContext propagatedContext) Adds propagated context to the Reactors' context.- Parameters:
context
- The context to be extendedpropagatedContext
- 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 PropagatedContextElement contextElement) Adds a context element to the Reactor's context.- Parameters:
context
- The context to be extendedcontextElement
- The propagated context element- Returns:
- The modified context
-
findContextElement
public static <E extends 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 contextcontextElementType
- The element type- Returns:
- optional context element
-
findAllContextElements
public static <E extends 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 contextcontextElementType
- The element type- Returns:
- optional context element
-
findPropagatedContext
public static Optional<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
-