Package io.opentelemetry.sdk.internal
Class DaemonThreadFactory
java.lang.Object
io.opentelemetry.sdk.internal.DaemonThreadFactory
- All Implemented Interfaces:
ThreadFactory
A
ThreadFactory that delegates to Executors.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
FieldsModifier and TypeFieldDescriptionprivate final AtomicIntegerprivate final ThreadFactoryprivate final Stringprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionDaemonThreadFactory(String namePrefix) DaemonThreadFactory(String namePrefix, boolean propagateContextForTesting) DaemonThreadFactory's constructor. -
Method Summary
-
Field Details
-
namePrefix
-
counter
-
delegate
-
propagateContextForTesting
private final boolean propagateContextForTesting
-
-
Constructor Details
-
DaemonThreadFactory
-
DaemonThreadFactory
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.
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-