public class CountingThreadFactory extends Object implements ThreadFactory
ThreadFactory
that maintains a count of how many threads this factory has createdConstructor and Description |
---|
CountingThreadFactory(ThreadFactory actualFactory)
Constructor accepting the actual thread factory that will create the threads
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfThreads()
Returns the number of threads this factory has created and currently alive
|
Thread |
newThread(Runnable r) |
public CountingThreadFactory(ThreadFactory actualFactory)
actualFactory
- the actual factorypublic Thread newThread(Runnable r)
newThread
in interface ThreadFactory
public int getNumberOfThreads()
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.