public class NamedThreadFactory extends Object implements ThreadFactory
foo, the threads created
by this factory will have names that look like fooX where
'X' is a monotonically increasing number used to name each thread created
by this factory uniquely.
The factory delegates the thread creation to
Executors.defaultThreadFactory(). After the
thread has been created by the delegated factory, this class simply
resets their name to the desired value.
| Constructor and Description |
|---|
NamedThreadFactory(String inNamePrefix)
Creates an instance that will create threads whose names begin with
the specified prefix.
|
public NamedThreadFactory(String inNamePrefix)
inNamePrefix - the prefix to use for naming every thread
created by this factory. Cannot be null.public Thread newThread(Runnable r)
newThread in interface ThreadFactoryCopyright © 2015. All Rights Reserved.