public class NamingThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
ThreadFactory
that gives (non-standard) names to new threads. If a name is a
IRunnableNameProvider
, the name provided by
IRunnableNameProvider.getRunnableName()
will be used, otherwise the
defaultName. The thread count (number of already created threads in this factory) will
always be appended.Constructor and Description |
---|
NamingThreadFactory(java.lang.String poolName) |
Modifier and Type | Method and Description |
---|---|
int |
getThreadCount() |
boolean |
isAddPoolName() |
boolean |
isCreateDaemonThreads() |
java.lang.Thread |
newThread(java.lang.Runnable r) |
void |
setAddPoolName(boolean addPoolName) |
void |
setCreateDaemonThreads(boolean createDaemonThreads) |
public java.lang.Thread newThread(java.lang.Runnable r)
newThread
in interface java.util.concurrent.ThreadFactory
public final boolean isCreateDaemonThreads()
public final void setCreateDaemonThreads(boolean createDaemonThreads)
public final int getThreadCount()
public final boolean isAddPoolName()
public final void setAddPoolName(boolean addPoolName)