Interface ThreadPropagatedContextElement<S>

Type Parameters:
S - The restore state type
All Superinterfaces:
PropagatedContextElement
All Known Implementing Classes:
MdcPropagationContext

public interface ThreadPropagatedContextElement<S> extends PropagatedContextElement
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 Type
    Method
    Description
    void
    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

      @Nullable S 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

      void restoreThreadContext(@Nullable S oldState)
      Restore the state on the propagation exit.
      Parameters:
      oldState - The state to be restored