Class DefaultContextPropagators
- java.lang.Object
-
- io.opentelemetry.context.propagation.DefaultContextPropagators
-
- All Implemented Interfaces:
ContextPropagators
final class DefaultContextPropagators extends java.lang.Object implements ContextPropagators
DefaultContextPropagatorsis the default, built-in implementation ofContextPropagators.All the registered propagators are stored internally as a simple list, and are invoked synchronically upon injection and extraction.
The propagation fields retrieved from all registered propagators are de-duplicated.
-
-
Field Summary
Fields Modifier and Type Field Description private static ContextPropagatorsNOOPprivate TextMapPropagatortextMapPropagator
-
Constructor Summary
Constructors Constructor Description DefaultContextPropagators(TextMapPropagator textMapPropagator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextMapPropagatorgetTextMapPropagator()Returns aTextMapPropagatorpropagator.(package private) static ContextPropagatorsnoop()Returns aContextPropagatorswhich performs no injection or extraction.java.lang.StringtoString()
-
-
-
Field Detail
-
NOOP
private static final ContextPropagators NOOP
-
textMapPropagator
private final TextMapPropagator textMapPropagator
-
-
Constructor Detail
-
DefaultContextPropagators
DefaultContextPropagators(TextMapPropagator textMapPropagator)
-
-
Method Detail
-
noop
static ContextPropagators noop()
Description copied from interface:ContextPropagatorsReturns aContextPropagatorswhich performs no injection or extraction.
-
getTextMapPropagator
public TextMapPropagator getTextMapPropagator()
Description copied from interface:ContextPropagatorsReturns aTextMapPropagatorpropagator.The returned value will be a composite instance containing all the registered
TextMapPropagatorpropagators. If none is registered, the returned value will be a no-op instance.- Specified by:
getTextMapPropagatorin interfaceContextPropagators- Returns:
- the
TextMapPropagatorpropagator to inject and extract data.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-