Class ContextHandleUtils
java.lang.Object
io.opencensus.trace.unsafe.ContextHandleUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContextHandlestatic SpangetValue(ContextHandle context) Returns the value from the specifiedContextHandle.static io.grpc.ContexttryExtractGrpcContext(ContextHandle handle) Attempts to pull theContextout of an OpenCensusContextHandle.static ContextHandlewithValue(ContextHandle context, Span span) Creates a newContextHandlewith the given value set.
-
Method Details
-
currentContext
-
withValue
Creates a newContextHandlewith the given value set.- Parameters:
context- the parentContextHandle.span- the value to be set.- Returns:
- a new context with the given value set.
-
getValue
Returns the value from the specifiedContextHandle.- Parameters:
context- the specifiedContextHandle.- Returns:
- the value from the specified
ContextHandle.
-
tryExtractGrpcContext
Attempts to pull theContextout of an OpenCensusContextHandle.- Returns:
- The context, or null if not a GRPC backed context handle.
-