Class SpanManager

    • Constructor Detail

      • SpanManager

        public SpanManager()
    • Method Detail

      • getActiveContext

        public Context<Span> getActiveContext()
        Return the active span as a Context.

        Please note: Closing this context will not close the corresponding OpenTracing scope as it is not ours to manage.

        Specified by:
        getActiveContext in interface ContextManager<Span>
        Returns:
        The currently active span as a context.
      • initializeNewContext

        public Context<Span> initializeNewContext​(Span span)
        Activates the given span.

        Closing the returned Context will also close the corresponding Scope as it was also activated by us.
        As a result of the opentracing 'rules' for scopes, every initialized Context must be closed.
        The span will not be automatically finished when the context is closed; this ContextManager just propagates the Span and does not concern itself with the Span's lifecycle.

        It is safe to close the resulting context more than once.

        No scope is activated if the specified Span is null.

        Specified by:
        initializeNewContext in interface ContextManager<Span>
        Parameters:
        span - The span to make the active span of the current OpenTracing scope.
        Returns:
        The new context that must be closed.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        Just the simple class name as this class carries no internal state.