public int getThreadCount ( ThreadGroup group , Status ... s ) { Thread [ ] threads = getThreads ( group ) ; int count = 0 ; for ( Thread t : threads ) { if ( t instanceof MonitoredThread ) { Status status = getStatus ( ( MonitoredThread ) t ) ; if ( status != null ) { for ( Status x : s ) { if ( x == status ) { count ++ ; } } } } } return count ; }
Return the count of threads that are in any of the statuses