forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultContextPropagators.java
41 lines (33 loc) · 1.12 KB
/
DefaultContextPropagators.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.context.propagation;
/**
* {@code DefaultContextPropagators} is the default, built-in implementation of {@link
* ContextPropagators}.
*
* <p>All the registered propagators are stored internally as a simple list, and are invoked
* synchronically upon injection and extraction.
*
* <p>The propagation fields retrieved from all registered propagators are de-duplicated.
*/
final class DefaultContextPropagators implements ContextPropagators {
private static final ContextPropagators NOOP =
new DefaultContextPropagators(NoopTextMapPropagator.getInstance());
static ContextPropagators noop() {
return NOOP;
}
private final TextMapPropagator textMapPropagator;
@Override
public TextMapPropagator getTextMapPropagator() {
return textMapPropagator;
}
DefaultContextPropagators(TextMapPropagator textMapPropagator) {
this.textMapPropagator = textMapPropagator;
}
@Override
public String toString() {
return "DefaultContextPropagators{textMapPropagator=" + textMapPropagator + "}";
}
}