Package hudson.util
Class NamingThreadFactory
- java.lang.Object
-
- hudson.util.NamingThreadFactory
-
- All Implemented Interfaces:
ThreadFactory
public final class NamingThreadFactory extends Object implements ThreadFactory
Thread factory that sets thread name so we know who is responsible for so many threads being created.- Since:
- 1.541
-
-
Constructor Summary
Constructors Constructor Description NamingThreadFactory(ThreadFactory delegate, String name)
Creates a new naming factory.
-
-
-
Constructor Detail
-
NamingThreadFactory
public NamingThreadFactory(ThreadFactory delegate, String name)
Creates a new naming factory.- Parameters:
delegate
- a baseline factory, such asExecutors.defaultThreadFactory()
orDaemonThreadFactory
orExceptionCatchingThreadFactory
name
- an identifier to be used in thread names; might be e.g. yourClass.getSimpleName()
-
-
Method Detail
-
newThread
public Thread newThread(Runnable r)
- Specified by:
newThread
in interfaceThreadFactory
-
-