Package io.opencensus.trace.unsafe
Class ContextHandleUtils
java.lang.Object
io.opencensus.trace.unsafe.ContextHandleUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextHandle
static Span
getValue
(ContextHandle context) Returns the value from the specifiedContextHandle
.private static ContextManager
loadContextManager
(ClassLoader classLoader) static io.grpc.Context
tryExtractGrpcContext
(ContextHandle handle) Attempts to pull theContext
out of an OpenCensusContextHandle
.static ContextHandle
withValue
(ContextHandle context, Span span) Creates a newContextHandle
with the given value set.
-
Field Details
-
LOGGER
-
CONTEXT_MANAGER
-
-
Constructor Details
-
ContextHandleUtils
private ContextHandleUtils()
-
-
Method Details
-
loadContextManager
-
currentContext
-
withValue
Creates a newContextHandle
with 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 theContext
out of an OpenCensusContextHandle
.- Returns:
- The context, or null if not a GRPC backed context handle.
-