io.opentelemetry.javaagent.bootstrap.CallDepthThreadLocalMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-javaagent-extension-api Show documentation
Show all versions of opentelemetry-javaagent-extension-api Show documentation
Instrumentation of Java libraries using OpenTelemetry.
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.bootstrap;
final class CallDepthThreadLocalMap {
private static final ClassValue TLS =
new ClassValue() {
@Override
protected ThreadLocalDepth computeValue(Class> type) {
return new ThreadLocalDepth();
}
};
static CallDepth getCallDepth(Class> k) {
return TLS.get(k).get();
}
private static final class ThreadLocalDepth extends ThreadLocal {
@Override
protected CallDepth initialValue() {
return new CallDepth();
}
}
private CallDepthThreadLocalMap() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy