/** * @param tracer The Tracer to use for tracing. * @param parent The TraceScope to read parent span ID from. * @param runnable The Runnable that will be executed. * @param description An optional description to set on the trace when executing. * @deprecated Use {@link #TraceRunnable(Tracer, SpanId, Runnable, String)} instead. */ @Deprecated public TraceRunnable(Tracer tracer, TraceScope parent, Runnable runnable, String description) { this(tracer, parent.getSpanId(), runnable, description); }
/** * @param tracer The Tracer to use for tracing. * @param parent The TraceScope to read parent span ID from. * @param runnable The Runnable that will be executed. * @param description An optional description to set on the trace when executing. * @deprecated Use {@link #TraceRunnable(Tracer, SpanId, Runnable, String)} instead. */ @Deprecated public TraceRunnable(Tracer tracer, TraceScope parent, Runnable runnable, String description) { this(tracer, parent.getSpanId(), runnable, description); }
/** * Wrap the callable in a TraceCallable, if tracing. * * @param <V> The subclass of callable. * @param callable The callable to wrap. * @param description A description of the callable, or null if there * is no description. * @return The callable provided, wrapped if tracing, 'callable' if not. */ public <V> Callable<V> wrap(Callable<V> callable, String description) { TraceScope parentScope = threadLocalScope.get(); if (parentScope == null) { return callable; } return new TraceCallable<V>(this, parentScope.getSpanId(), callable, description); }
/** * Wrap the callable in a TraceCallable, if tracing. * * @param <V> The subclass of callable. * @param callable The callable to wrap. * @param description A description of the callable, or null if there * is no description. * @return The callable provided, wrapped if tracing, 'callable' if not. */ public <V> Callable<V> wrap(Callable<V> callable, String description) { TraceScope parentScope = threadLocalScope.get(); if (parentScope == null) { return callable; } return new TraceCallable<V>(this, parentScope.getSpanId(), callable, description); }
spanId = scope.getSpanId(); scope.detach(); one.setTraceScope(scope);