public final class NameThreadFactory extends Object implements ThreadFactory
ThreadFactory
that creates Thread
s with a name. Use this to make it easier to find where the different threads are
created from.Modifier and Type | Field and Description |
---|---|
static String |
CLASS_VERSION
The version of this class.
|
Constructor and Description |
---|
NameThreadFactory(Class pClazz,
String pThreadName)
Constructs a ThreadFactory that creates Threads with a name on the following format:
pClass.getName()-pThreadName-X where X is the thread
number since the factory was created, zero-based. |
NameThreadFactory(Class pClazz,
String pThreadName,
boolean pDeamon)
Constructs a ThreadFactory that creates Threads with a name on the following format:
pClass.getName()-pThreadName-X where X is the thread
number since the factory was created, zero-based. |
public static final String CLASS_VERSION
public NameThreadFactory(Class pClazz, String pThreadName)
Constructs a ThreadFactory that creates Threads with a name on the following format: pClass.getName()-pThreadName-X
where X
is the thread
number since the factory was created, zero-based.
Will create threads where Thread.isDaemon()
returns false
pClazz
- the class we will create threads inpThreadName
- the unique name of the threads created by this ThreadFactory
public NameThreadFactory(Class pClazz, String pThreadName, boolean pDeamon)
pClass.getName()-pThreadName-X
where X
is the thread
number since the factory was created, zero-based.pClazz
- the class we will create threads inpThreadName
- the unique name of the threads created by this ThreadFactory
pDeamon
- if the threads created by this ThreadFactory
should have Thread.isDaemon()
return true
public Thread newThread(Runnable pRunnable)
newThread
in interface ThreadFactory
© 1998- 2018 Stibo DX