Module io.helidon.common.context
Package io.helidon.common.context.spi
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 methoddata()
invoked before thread switch, to obtain value for propagation. After the thread is switched, the new thread executespropagateData(Object)
to propagate data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
clearData()
Deprecated, for removal: This API element is subject to removal in a future version.since 2.3.2, please useclearData(Object)
default void
clearData(T data)
Clears the propagated data from the new thread when it finishes.T
data()
Return data that should be propagated.void
propagateData(T data)
Propagates the data to be used by the new thread.
-
-
-
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 useclearData(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
-
-