Class ContextUtils

java.lang.Object
io.opencensus.trace.unsafe.ContextUtils

@Deprecated public final class ContextUtils extends Object
Deprecated.
Please use ContextHandleUtils Util methods/functionality to interact with the Context. Users must interact with the current Context via the public APIs in Tracer and avoid usages of the CONTEXT_SPAN_KEY directly.
Utilities for grabbing manipulating current context and grabbing current span.
Since:
0.5
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final io.grpc.Context.Key<Span>
    Deprecated.
    The Context.Key used to interact with Context.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Span
    getValue(io.grpc.Context context)
    Deprecated.
    Returns the value from the specified Context.
    static io.grpc.Context
    withValue(io.grpc.Context context, Span span)
    Deprecated.
    Creates a new Context with the given value set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONTEXT_SPAN_KEY

      private static final io.grpc.Context.Key<Span> CONTEXT_SPAN_KEY
      Deprecated.
      The Context.Key used to interact with Context.
  • Constructor Details

    • ContextUtils

      private ContextUtils()
      Deprecated.
  • Method Details

    • withValue

      public static io.grpc.Context withValue(io.grpc.Context context, @Nullable Span span)
      Deprecated.
      Creates a new Context with the given value set.
      Parameters:
      context - the parent Context.
      span - the value to be set.
      Returns:
      a new context with the given value set.
      Since:
      0.21
    • getValue

      public static Span getValue(io.grpc.Context context)
      Deprecated.
      Returns the value from the specified Context.
      Parameters:
      context - the specified Context.
      Returns:
      the value from the specified Context.
      Since:
      0.21