Class NamedThreadFactory
java.lang.Object
com.playtika.janusgraph.aerospike.util.NamedThreadFactory
- All Implemented Interfaces:
ThreadFactory
ThreadFactory with the ability to set the thread name prefix.
This class is exactly similar to
Executors.defaultThreadFactory()
from JDK8, except for the thread naming feature.
The factory creates threads that have names on the form prefix-N-thread-M, where prefix is a string provided in the constructor, N is the sequence number of this factory, and M is the sequence number of the thread created by this factory.
-
Constructor Summary
ConstructorsConstructorDescriptionNamedThreadFactory(String groupName, String prefix) Creates a new ThreadFactory where threads are created with a name prefix ofprefix. -
Method Summary
-
Constructor Details
-
NamedThreadFactory
Creates a new ThreadFactory where threads are created with a name prefix ofprefix.- Parameters:
prefix- Thread name prefix. Never use a value of "pool" as in that case you might as well have usedExecutors.defaultThreadFactory().
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-