net.sf.ehcache.constructs.nonstop.util
Class CountingThreadFactory
java.lang.Object
net.sf.ehcache.constructs.nonstop.util.CountingThreadFactory
- All Implemented Interfaces:
- ThreadFactory
public class CountingThreadFactory
- extends Object
- implements ThreadFactory
A custom ThreadFactory
that maintains a count of how many threads this factory has created
- Author:
- Abhishek Sanoujam
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountingThreadFactory
public CountingThreadFactory(ThreadFactory actualFactory)
- Constructor accepting the actual thread factory that will create the threads
- Parameters:
actualFactory
- the actual factory
newThread
public Thread newThread(Runnable r)
-
- Specified by:
newThread
in interface 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
Copyright 2001-2016, Terracotta, Inc.