Package io.micronaut.core.propagation
Interface ThreadPropagatedContextElement<S>
- Type Parameters:
S
- The restore state type
- All Superinterfaces:
PropagatedContextElement
- All Known Implementing Classes:
MdcPropagationContext
Special version of
PropagatedContextElement
that is thread-aware and can update the thread context on the initial propagation entry
and restore it on the propagation exist.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionvoid
restoreThreadContext
(S oldState) Restore the state on the propagation exit.Update the thread context on the propagation entry and return the state that will be used for the restore on the propagation exit.
-
Method Details
-
updateThreadContext
Update the thread context on the propagation entry and return the state that will be used for the restore on the propagation exit.- Returns:
- The state to be restored
-
restoreThreadContext
Restore the state on the propagation exit.- Parameters:
oldState
- The state to be restored
-