Class ContextHandleUtils
java.lang.Object
io.opencensus.trace.unsafe.ContextHandleUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextHandlestatic SpangetValue(ContextHandle context) Returns the value from the specifiedContextHandle.private static ContextManagerloadContextManager(ClassLoader classLoader) 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.
-
Field Details
-
LOGGER
-
CONTEXT_MANAGER
-
-
Constructor Details
-
ContextHandleUtils
private ContextHandleUtils()
-
-
Method Details
-
loadContextManager
-
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.
-