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