Package org.apache.lucene.util
Class NamedThreadFactory
- java.lang.Object
-
- org.apache.lucene.util.NamedThreadFactory
-
- All Implemented Interfaces:
ThreadFactory
public class NamedThreadFactory extends Object implements ThreadFactory
A defaultThreadFactory
implementation that accepts the name prefix of the created threads as a constructor argument. Otherwise, this factory yields the same semantics as the thread factory returned byExecutors.defaultThreadFactory()
.
-
-
Constructor Summary
Constructors Constructor Description NamedThreadFactory(String threadNamePrefix)
Creates a newNamedThreadFactory
instance
-
-
-
Constructor Detail
-
NamedThreadFactory
public NamedThreadFactory(String threadNamePrefix)
Creates a newNamedThreadFactory
instance- Parameters:
threadNamePrefix
- the name prefix assigned to each thread created.
-
-
Method Detail
-
newThread
public Thread newThread(Runnable r)
Creates a newThread
- Specified by:
newThread
in interfaceThreadFactory
- See Also:
ThreadFactory.newThread(java.lang.Runnable)
-
-