Class CountingThreadFactory
- java.lang.Object
-
- net.sf.ehcache.constructs.nonstop.util.CountingThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public class CountingThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactoryA customThreadFactorythat maintains a count of how many threads this factory has created- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description CountingThreadFactory(java.util.concurrent.ThreadFactory actualFactory)Constructor accepting the actual thread factory that will create the threads
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNumberOfThreads()Returns the number of threads this factory has created and currently alivejava.lang.ThreadnewThread(java.lang.Runnable r)
-
-
-
Method Detail
-
newThread
public java.lang.Thread newThread(java.lang.Runnable r)
- Specified by:
newThreadin interfacejava.util.concurrent.ThreadFactory
-
getNumberOfThreads
public int getNumberOfThreads()
Returns the number of threads this factory has created and currently alive- Returns:
- Returns the number of threads this factory has created and currently alive
-
-