Package io.opencensus.trace.unsafe
Class ContextUtils
- java.lang.Object
-
- io.opencensus.trace.unsafe.ContextUtils
-
@Deprecated public final class ContextUtils extends java.lang.Object
Deprecated.Please useContextHandleUtils
Util methods/functionality to interact with theContext
. Users must interact with the current Context via the public APIs inTracer
and avoid usages of theCONTEXT_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 io.grpc.Context.Key<Span>
CONTEXT_SPAN_KEY
Deprecated.TheContext.Key
used to interact withContext
.
-
Constructor Summary
Constructors Modifier Constructor Description private
ContextUtils()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Span
getValue(io.grpc.Context context)
Deprecated.Returns the value from the specifiedContext
.static io.grpc.Context
withValue(io.grpc.Context context, Span span)
Deprecated.Creates a newContext
with the given value set.
-
-
-
Field Detail
-
CONTEXT_SPAN_KEY
private static final io.grpc.Context.Key<Span> CONTEXT_SPAN_KEY
Deprecated.TheContext.Key
used to interact withContext
.
-
-
Method Detail
-
withValue
public static io.grpc.Context withValue(io.grpc.Context context, @Nullable Span span)
Deprecated.Creates a newContext
with the given value set.- Parameters:
context
- the parentContext
.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 specifiedContext
.- Parameters:
context
- the specifiedContext
.- Returns:
- the value from the specified
Context
. - Since:
- 0.21
-
-