Package org.eclipse.hono.util
Interface ExecutionContext
- All Known Implementing Classes:
MapBasedExecutionContext
public interface ExecutionContext
A container for information relevant for processing a message sent by a device.
Provides means to store arbitrary key/value pairs.
-
Method Summary
Modifier and TypeMethodDescription<T> T
Gets the value for a key.<T> T
Gets the value for a key.io.opentracing.SpanContext
Gets the OpenTracing context that is used to track the processing of this context.io.opentracing.Span
Gets the OpenTracing root span that is used to track the processing of this context.void
Sets a value for a key.
-
Method Details
-
get
Gets the value for a key.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key to get the value for.- Returns:
- The value or
null
if the key is unknown.
-
get
Gets the value for a key.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key to get the value for.defaultValue
- The value to return if the key is unknown.- Returns:
- The value.
-
put
Sets a value for a key.- Parameters:
key
- The key.value
- The value.
-
getTracingContext
io.opentracing.SpanContext getTracingContext()Gets the OpenTracing context that is used to track the processing of this context.- Returns:
- The context or
null
if no tracing context is set.
-
getTracingSpan
io.opentracing.Span getTracingSpan()Gets the OpenTracing root span that is used to track the processing of this context.- Returns:
- The span or
null
if no span is set.
-