public class NamedDaemonThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
Thread.setDaemon(boolean)
,
Thread.setName(String)
Constructor and Description |
---|
NamedDaemonThreadFactory(java.lang.String prefix)
Creates a new thread factory that will name its threads <prefix>-<n>, where
<prefix> is the given
prefix and <n> is the count of threads
created thus far by this class. |
NamedDaemonThreadFactory(java.lang.String prefix,
java.lang.ClassLoader contextClassLoader)
Creates a new thread factory that will name its threads <prefix>-<n>, where
<prefix> is the given
prefix and <n> is the count of threads
created thus far by this class. |
NamedDaemonThreadFactory(java.lang.String prefix,
java.lang.ClassLoader contextClassLoader,
java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
boolean daemon) |
Modifier and Type | Method and Description |
---|---|
java.lang.Thread |
newThread(java.lang.Runnable runnable) |
public NamedDaemonThreadFactory(java.lang.String prefix)
prefix
and <n> is the count of threads
created thus far by this class.prefix
- The thread name prefixpublic NamedDaemonThreadFactory(java.lang.String prefix, java.lang.ClassLoader contextClassLoader)
prefix
and <n> is the count of threads
created thus far by this class. If the contextClassLoader parameter is not null it will assign it to the forged
Threadprefix
- The thread name prefixcontextClassLoader
- An optional classLoader to assign to threadpublic NamedDaemonThreadFactory(java.lang.String prefix, java.lang.ClassLoader contextClassLoader, java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler, boolean daemon)