public class NamedThreadFactory extends Object implements ThreadFactory
ThreadFactory that sets names to the threads created by this factory. Threads created by this factory
will take names in the form of the string namePrefix + " thread-" + threadNum where threadNum is the
count of threads created by this type of factory.| Constructor and Description |
|---|
NamedThreadFactory(String namePrefix)
Constructor accepting the prefix of the threads that will be created by this
ThreadFactory |
NamedThreadFactory(String namePrefix,
boolean daemon)
Constructor accepting the prefix of the threads that will be created by this
ThreadFactory |
| Modifier and Type | Method and Description |
|---|---|
Thread |
newThread(Runnable runnable)
Returns a new thread using a name as specified by this factory
|
public NamedThreadFactory(String namePrefix, boolean daemon)
ThreadFactorynamePrefix - Prefix for names of threadspublic NamedThreadFactory(String namePrefix)
ThreadFactorynamePrefix - Prefix for names of threadspublic Thread newThread(Runnable runnable)
newThread in interface ThreadFactoryCopyright 2001-2021, Terracotta, Inc.