ThreadFactory that sets names to the threads created by this factory. Threads created by this factory
will take names in the form of the string namePrefix + " thread-" + threadNum where threadNum is the
count of threads created by this type of factory.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final String | |
| private static AtomicInteger |
| Access | Constructor and Description |
|---|---|
| public | NamedThreadFactory(String
Prefix for names of threads namePrefix, boolean daemon)Constructor accepting the prefix of the threads that will be created by this |
| public | NamedThreadFactory(String
Prefix for names of threads namePrefix)Constructor accepting the prefix of the threads that will be created by this |
| Modifier and Type | Method and Description |
|---|---|
| public Thread | newThread(Runnable
a runnable to be executed by new thread instance runnable)Implements java. Thread to run the given runnable.
|
| daemon | back to summary |
|---|---|
| private final boolean daemon | |
| namePrefix | back to summary |
|---|---|
| private final String namePrefix | |
| threadNumber | back to summary |
|---|---|
| private static AtomicInteger threadNumber | |
| NamedThreadFactory | back to summary |
|---|---|
| public NamedThreadFactory(String namePrefix, boolean daemon) Constructor accepting the prefix of the threads that will be created by this
| |
| NamedThreadFactory | back to summary |
|---|---|
| public NamedThreadFactory(String namePrefix) Constructor accepting the prefix of the threads that will be created by this
| |
| newThread | back to summary |
|---|---|
| public Thread newThread(Runnable runnable) Implements java. Doc from java. Returns a new thread using a name as specified by this factory Constructs a new unstarted | |