Class MapBasedExecutionContext

java.lang.Object
org.eclipse.hono.util.MapBasedExecutionContext
All Implemented Interfaces:
ExecutionContext

public abstract class MapBasedExecutionContext extends Object implements ExecutionContext
An execution context that stores properties in a Map.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapBasedExecutionContext(io.opentracing.Span span)
    Creates a new MapBasedExecutionContext instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    final <T> T
    get(String key)
    Gets the value for a key.
    final <T> T
    get(String key, T defaultValue)
    Gets the value for a key.
    final io.opentracing.SpanContext
    Gets the OpenTracing context that is used to track the processing of this context.
    final io.opentracing.Span
    Gets the OpenTracing root span that is used to track the processing of this context.
    final void
    put(String key, Object value)
    Sets a value for a key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapBasedExecutionContext

      public MapBasedExecutionContext(io.opentracing.Span span)
      Creates a new MapBasedExecutionContext instance.
      Parameters:
      span - The OpenTracing root span that is used to track the processing of this context.
      Throws:
      NullPointerException - If span is null.
  • Method Details

    • get

      public final <T> T get(String key)
      Description copied from interface: ExecutionContext
      Gets the value for a key.
      Specified by:
      get in interface ExecutionContext
      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

      public final <T> T get(String key, T defaultValue)
      Description copied from interface: ExecutionContext
      Gets the value for a key.
      Specified by:
      get in interface ExecutionContext
      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

      public final void put(String key, Object value)
      Description copied from interface: ExecutionContext
      Sets a value for a key.
      Specified by:
      put in interface ExecutionContext
      Parameters:
      key - The key.
      value - The value.
    • getTracingSpan

      public final io.opentracing.Span getTracingSpan()
      Gets the OpenTracing root span that is used to track the processing of this context.
      Specified by:
      getTracingSpan in interface ExecutionContext
      Returns:
      The span.
    • getTracingContext

      public final io.opentracing.SpanContext getTracingContext()
      Description copied from interface: ExecutionContext
      Gets the OpenTracing context that is used to track the processing of this context.
      Specified by:
      getTracingContext in interface ExecutionContext
      Returns:
      The context or null if no tracing context is set.