Class FixedNameThreadFactory
java.lang.Object
com.iohao.net.common.kit.concurrent.ThreadCreator
com.iohao.net.common.kit.concurrent.FixedNameThreadFactory
- All Implemented Interfaces:
ThreadFactory
A
ThreadFactory that creates daemon threads with a fixed (non-incrementing) name.- Since:
- 21.15
- Author:
- 渔民小镇
- date:
- 2024-08-10
-
Field Summary
Fields inherited from class ThreadCreator
daemon, threadCount, threadGroup, threadNamePrefix, threadPriority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGenerate the next thread name using the prefix and an auto-incrementing counter.Methods inherited from class ThreadCreator
createThread, setThreadGroupName
-
Constructor Details
-
FixedNameThreadFactory
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-
nextThreadName
Description copied from class:ThreadCreatorGenerate the next thread name using the prefix and an auto-incrementing counter.- Overrides:
nextThreadNamein classThreadCreator- Returns:
- the next thread name
-