Package io.opentelemetry.sdk.internal
Class DaemonThreadFactory
- java.lang.Object
-
- io.opentelemetry.sdk.internal.DaemonThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public final class DaemonThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactoryAThreadFactorythat delegates toExecutors.defaultThreadFactory()and marks all threads as daemon.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicIntegercounterprivate java.util.concurrent.ThreadFactorydelegateprivate java.lang.StringnamePrefixprivate booleanpropagateContextForTesting
-
Constructor Summary
Constructors Constructor Description DaemonThreadFactory(java.lang.String namePrefix)DaemonThreadFactory(java.lang.String namePrefix, boolean propagateContextForTesting)DaemonThreadFactory's constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThreadnewThread(java.lang.Runnable runnable)
-
-
-
Constructor Detail
-
DaemonThreadFactory
public DaemonThreadFactory(java.lang.String namePrefix)
-
DaemonThreadFactory
public DaemonThreadFactory(java.lang.String namePrefix, boolean propagateContextForTesting)DaemonThreadFactory's constructor.- Parameters:
namePrefix- Used when setting the new thread's name.propagateContextForTesting- For tests only. When enabled, the current thread'sContextwill be passed over to the new threads, this is useful for validating scenarios where context propagation is available through bytecode instrumentation.
-
-