- java.lang.Object
-
- brave.internal.PropagationFields
-
- Direct Known Subclasses:
MapPropagationFields,PredefinedPropagationFields
public abstract class PropagationFields extends java.lang.ObjectWe need to retain propagation state extracted from headers. However, we don't know the trace identifiers, yet. In order to resolve this ordering concern, we create an object to hold extra state, and defer associating it with a span ID (viaExtraFactory.decorate(TraceContext).Implementations of this type should use copy-on-write semantics to prevent changes in a child context from affecting its parent.
-
-
Constructor Summary
Constructors Constructor Description PropagationFields()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringget(TraceContext context, java.lang.String name, java.lang.Class<? extends PropagationFields> type)Returns the value of the field with the specified key or null if not availableabstract java.lang.Stringget(java.lang.String name)Returns the value of the field with the specified key or null if not availablestatic voidput(TraceContext context, java.lang.String name, java.lang.String value, java.lang.Class<? extends PropagationFields> type)Replaces the value of the field with the specified key, ignoring if not a permitted fieldabstract voidput(java.lang.String name, java.lang.String value)Replaces the value of the field with the specified key, ignoring if not a permitted fieldabstract java.util.Map<java.lang.String,java.lang.String>toMap()java.lang.StringtoString()
-
-
-
Method Detail
-
get
public abstract java.lang.String get(java.lang.String name)
Returns the value of the field with the specified key or null if not available
-
put
public abstract void put(java.lang.String name, java.lang.String value)Replaces the value of the field with the specified key, ignoring if not a permitted field
-
toMap
public abstract java.util.Map<java.lang.String,java.lang.String> toMap()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
get
public static java.lang.String get(TraceContext context, java.lang.String name, java.lang.Class<? extends PropagationFields> type)
Returns the value of the field with the specified key or null if not available
-
put
public static void put(TraceContext context, java.lang.String name, java.lang.String value, java.lang.Class<? extends PropagationFields> type)
Replaces the value of the field with the specified key, ignoring if not a permitted field
-
-