public class NamedThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
| Constructor and Description |
|---|
NamedThreadFactory()
Create a default thread factory
|
NamedThreadFactory(java.lang.String baseName)
Create a factory with a base name
|
NamedThreadFactory(java.lang.String baseName,
java.lang.ThreadGroup threadGroup)
Creates a factory that uses a base name and a thread group
|
NamedThreadFactory(java.lang.String baseName,
java.lang.ThreadGroup threadGroup,
boolean createAsDaemonThread)
Creates a factory that uses a base name and a thread group
|
NamedThreadFactory(java.lang.String baseName,
java.lang.ThreadGroup threadGroup,
boolean createAsDaemonThread,
int priority)
Creates a factory that uses a base name and a thread group
|
NamedThreadFactory(java.lang.String baseName,
java.lang.ThreadGroup threadGroup,
int priority)
Creates a factory that uses a base name and a thread group
|
NamedThreadFactory(java.lang.ThreadGroup threadGroup)
Create a factory that creates threads into the specified group
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Thread |
newThread(java.lang.Runnable runnable) |
public NamedThreadFactory()
public NamedThreadFactory(@Nullable java.lang.String baseName)
baseName - The name to use, or null for a default namepublic NamedThreadFactory(@Nullable java.lang.ThreadGroup threadGroup)
threadGroup - The group to use, or null for the system grouppublic NamedThreadFactory(@Nullable java.lang.String baseName, @Nullable java.lang.ThreadGroup threadGroup)
baseName - The name to use, or null for a default namethreadGroup - The group to use, or null for the system grouppublic NamedThreadFactory(@Nullable java.lang.String baseName, @Nullable java.lang.ThreadGroup threadGroup, int priority)
baseName - The name to use, or null for a default namethreadGroup - The group to use, or null for the system grouppriority - The default priority to use for new threads (if the group won't allow this priority then the largest allowed priority is used instead)public NamedThreadFactory(@Nullable java.lang.String baseName, @Nullable java.lang.ThreadGroup threadGroup, boolean createAsDaemonThread)
baseName - The name to use, or null for a default namethreadGroup - The group to use, or null for the system groupcreateAsDaemonThread - True to create threads as daemon threads (true means the thread won't block JVM exiting), false otherwisepublic NamedThreadFactory(@Nullable java.lang.String baseName, @Nullable java.lang.ThreadGroup threadGroup, boolean createAsDaemonThread, int priority)
baseName - The name to use, or null for a default namethreadGroup - The group to use, or null for the system groupcreateAsDaemonThread - True to create threads as daemon threads (true means the thread won't block JVM exiting), false otherwisepriority - The default priority to use for new threads (if the group won't allow this priority then the largest allowed priority is used instead)