Interface CapturedContext


public interface CapturedContext
A representation of a context state that can be attached to the current thread. Instances represent captured context state which includes things like the AsyncContext state and potentially additional state if instances of CapturedContextProvider are found. This state can be attached to the current thread via the attachContext() method which will return a Scope used to detach this state, restoring any context information that existed beforehand.
  • Method Details

    • captured

      ContextMap captured()
      The ContextMap that was captured.
      Returns:
      ContextMap that was captured.
    • attachContext

      Scope attachContext()
      Attach the captured context to the thread state.
      Returns:
      a Scope that will be used to restore the previous context associated with the current thread state when the scoped operation completes.