Package net.sf.ehcache.util
Class NamedThreadFactory
- java.lang.Object
-
- net.sf.ehcache.util.NamedThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public class NamedThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactoryAThreadFactorythat sets names to the threads created by this factory. Threads created by this factory will take names in the form of the stringnamePrefix + " thread-" + threadNumwhere threadNum is the count of threads created by this type of factory.- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description NamedThreadFactory(java.lang.String namePrefix)Constructor accepting the prefix of the threads that will be created by thisThreadFactoryNamedThreadFactory(java.lang.String namePrefix, boolean daemon)Constructor accepting the prefix of the threads that will be created by thisThreadFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThreadnewThread(java.lang.Runnable runnable)Returns a new thread using a name as specified by this factory
-
-
-
Constructor Detail
-
NamedThreadFactory
public NamedThreadFactory(java.lang.String namePrefix, boolean daemon)Constructor accepting the prefix of the threads that will be created by thisThreadFactory- Parameters:
namePrefix- Prefix for names of threads
-
NamedThreadFactory
public NamedThreadFactory(java.lang.String namePrefix)
Constructor accepting the prefix of the threads that will be created by thisThreadFactory- Parameters:
namePrefix- Prefix for names of threads
-
-