CurrentTraceContext.Default
, StrictCurrentTraceContext
public abstract class CurrentTraceContext extends Object
This type is an SPI, and intended to be used by implementors looking to change thread-local storage, or integrate with other contexts such as logging (MDC).
Modifier and Type | Class | Description |
---|---|---|
static class |
CurrentTraceContext.Default |
Default implementation which is backed by a static thread local.
|
static interface |
CurrentTraceContext.Scope |
A span remains in the scope it was bound to until close is called.
|
Constructor | Description |
---|---|
CurrentTraceContext() |
Modifier and Type | Method | Description |
---|---|---|
Executor |
executor(Executor delegate) |
Decorates the input such that the
current trace context at the time a task is
scheduled is made current when the task is executed. |
ExecutorService |
executorService(ExecutorService delegate) |
Decorates the input such that the
current trace context at the time a task is
scheduled is made current when the task is executed. |
abstract TraceContext |
get() |
Returns the current span in scope or null if there isn't one.
|
abstract CurrentTraceContext.Scope |
newScope(TraceContext currentSpan) |
Sets the current span in scope until the returned object is closed.
|
Runnable |
wrap(Runnable task) |
Wraps the input so that it executes with the same context as now.
|
<C> Callable<C> |
wrap(Callable<C> task) |
Wraps the input so that it executes with the same context as now.
|
@Nullable public abstract TraceContext get()
public abstract CurrentTraceContext.Scope newScope(@Nullable TraceContext currentSpan)
currentSpan
- span to place into scope or null to clear the scopepublic <C> Callable<C> wrap(Callable<C> task)
public Runnable wrap(Runnable task)
public Executor executor(Executor delegate)
current trace context
at the time a task is
scheduled is made current when the task is executed.public ExecutorService executorService(ExecutorService delegate)
current trace context
at the time a task is
scheduled is made current when the task is executed.Copyright © 2018 OpenZipkin. All rights reserved.