Search in sources :

Example 1 with SpanProvider

use of com.amazon.ion.SpanProvider in project ion-java by amzn.

the class Spans method currentSpan.

/**
 * Attempts to get a {@link Span} from the given object, if it
 * supports {@link SpanProvider#currentSpan()}.
 *
 * @param spanProvider may be null.
 * @return null if there's not a current span.
 */
public static Span currentSpan(Object spanProvider) {
    SpanProvider sp = asFacet(SpanProvider.class, spanProvider);
    Span span = (sp == null ? null : sp.currentSpan());
    return span;
}
Also used : SpanProvider(com.amazon.ion.SpanProvider) Span(com.amazon.ion.Span)

Aggregations

Span (com.amazon.ion.Span)1 SpanProvider (com.amazon.ion.SpanProvider)1