Class DefaultContextPropagators
- java.lang.Object
-
- io.opentelemetry.context.propagation.DefaultContextPropagators
-
- All Implemented Interfaces:
ContextPropagators
final class DefaultContextPropagators extends java.lang.Object implements ContextPropagators
DefaultContextPropagators
is 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 ContextPropagators
NOOP
private TextMapPropagator
textMapPropagator
-
Constructor Summary
Constructors Constructor Description DefaultContextPropagators(TextMapPropagator textMapPropagator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextMapPropagator
getTextMapPropagator()
Returns aTextMapPropagator
propagator.(package private) static ContextPropagators
noop()
Returns aContextPropagators
which performs no injection or extraction.java.lang.String
toString()
-
-
-
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:ContextPropagators
Returns aContextPropagators
which performs no injection or extraction.
-
getTextMapPropagator
public TextMapPropagator getTextMapPropagator()
Description copied from interface:ContextPropagators
Returns aTextMapPropagator
propagator.The returned value will be a composite instance containing all the registered
TextMapPropagator
propagators. If none is registered, the returned value will be a no-op instance.- Specified by:
getTextMapPropagator
in interfaceContextPropagators
- Returns:
- the
TextMapPropagator
propagator to inject and extract data.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-