Top Inners Fields Constructors Methods
io.opentelemetry.context

pack-priv final Enum ThreadLocalContextStorage

extends Enum<ThreadLocalContextStorage>
implements ContextStorage
Class Inheritance
All Implemented Interfaces
io.opentelemetry.context.ContextStorage
Imports
java.util.logging.Level, .Logger, javax.annotation.Nullable

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
private class

Field Summary

Modifier and TypeField and Description
public static final ThreadLocalContextStorage
private static final Logger
private static final ThreadLocal<Context>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Scope
attach(Context toAttach)

Implements io.opentelemetry.context.ContextStorage.attach.

Sets the specified Context as the current Context and returns a Scope representing the scope of execution.

public Context
public static ThreadLocalContextStorage
public static ThreadLocalContextStorage[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final ThreadLocalContextStorage INSTANCE
loggerback to summary
private static final Logger logger
THREAD_LOCAL_STORAGEback to summary
private static final ThreadLocal<Context> THREAD_LOCAL_STORAGE

Constructor Detail

ThreadLocalContextStorageback to summary
private ThreadLocalContextStorage()

Method Detail

attachback to summary
public Scope attach(Context toAttach)

Implements io.opentelemetry.context.ContextStorage.attach.

Doc from io.opentelemetry.context.ContextStorage.attach.

Sets the specified Context as the current Context and returns a Scope representing the scope of execution. Scope#close() must be called when the current Context should be restored to what it was before attaching toAttach.

Annotations
@Override
currentback to summary
public Context current()

Implements io.opentelemetry.context.ContextStorage.current.

Doc from io.opentelemetry.context.ContextStorage.current.

Returns the current Context. If no Context has been attached yet, this will return null.

Annotations
@Override
@Nullable
valueOfback to summary
public static ThreadLocalContextStorage valueOf(String name)
valuesback to summary
public static ThreadLocalContextStorage[] values()
io.opentelemetry.context back to summary

pack-priv final Enum ThreadLocalContextStorage.NoopScope

extends Enum<ThreadLocalContextStorage.NoopScope>
implements Scope
Class Inheritance
All Implemented Interfaces
io.opentelemetry.context.Scope, java.lang.AutoCloseable

Field Summary

Modifier and TypeField and Description
public static final ThreadLocalContextStorage.NoopScope

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.opentelemetry.context.Scope.close.

Closes this resource, relinquishing any underlying resources.

public static ThreadLocalContextStorage.NoopScope
public static ThreadLocalContextStorage.NoopScope[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final ThreadLocalContextStorage.NoopScope INSTANCE

Constructor Detail

NoopScopeback to summary
private NoopScope()

Method Detail

closeback to summary
public void close()

Implements io.opentelemetry.context.Scope.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
valueOfback to summary
public static ThreadLocalContextStorage.NoopScope valueOf(String name)
valuesback to summary
public static ThreadLocalContextStorage.NoopScope[] values()
io.opentelemetry.context back to summary

private Class ThreadLocalContextStorage.ScopeImpl

extends Object
implements Scope
Class Inheritance
All Implemented Interfaces
io.opentelemetry.context.Scope, java.lang.AutoCloseable

Field Summary

Modifier and TypeField and Description
private final Context
private boolean
private final Context

Constructor Summary

AccessConstructor and Description
private
ScopeImpl(Context beforeAttach, Context toAttach)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.opentelemetry.context.Scope.close.

Closes this resource, relinquishing any underlying resources.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beforeAttachback to summary
private final Context beforeAttach
Annotations
@Nullable
closedback to summary
private boolean closed
toAttachback to summary
private final Context toAttach

Constructor Detail

ScopeImplback to summary
private ScopeImpl(Context beforeAttach, Context toAttach)

Method Detail

closeback to summary
public void close()

Implements io.opentelemetry.context.Scope.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override