Module brave

Class PropagationFields

  • Direct Known Subclasses:
    MapPropagationFields, PredefinedPropagationFields

    public abstract class PropagationFields
    extends java.lang.Object
    We 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 (via ExtraFactory.decorate(TraceContext).

    Implementations of this type should use copy-on-write semantics to prevent changes in a child context from affecting its parent.

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      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
      abstract java.lang.String get​(java.lang.String name)
      Returns the value of the field with the specified key or null if not available
      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
      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
      abstract java.util.Map<java.lang.String,​java.lang.String> toMap()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PropagationFields

        public PropagationFields()
    • 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:
        toString in class java.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