Interface DataPropagationProvider<T>

  • Type Parameters:
    T - an actual type of the data which will be propagated
    All Known Implementing Classes:
    JaegerDataPropagationProvider, JulMdcPropagator, Slf4jMdcPropagator

    public interface DataPropagationProvider<T>
    This is an SPI provider which helps user to propagate values from one thread to another. Every provider has its method data() invoked before thread switch, to obtain value for propagation. After the thread is switched, the new thread executes propagateData(Object) to propagate data.
    • Method Detail

      • data

        T data()
        Return data that should be propagated.
        Returns:
        data for propagation
      • propagateData

        void propagateData​(T data)
        Propagates the data to be used by the new thread.
        Parameters:
        data - data for propagation
      • clearData

        @Deprecated(since="2.3.2",
                    forRemoval=true)
        default void clearData()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2.3.2, please use clearData(Object)
        Clears the propagated data from the new thread when it finishes.
      • clearData

        default void clearData​(T data)
        Clears the propagated data from the new thread when it finishes.
        Parameters:
        data - data for propagation