}
public void registerJVMThreadInfoStats(StatsHolder rootNode) throws
MonitoringRegistrationException {
final StatsHolder jvmNode = rootNode.getChild(MonitoredObjectType.JVM.getTypeName());
assert(jvmNode != null): "jvm node is null";
final StatsHolder threadSystemNode = jvmNode.getChild(MonitoredObjectType.JVM_THREAD.getTypeName());
assert(threadSystemNode != null): "thread-system node is null";
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
long ids[] = bean.getAllThreadIds();
for(int i=0; i < ids.length; i++) {
ThreadInfo info = bean.getThreadInfo(ids[i], STACK_DEPTH);
String threadName = THREAD_NODE_NAME + "-" + ids[i];
StatsHolder childNode = threadSystemNode.addChild(threadName, MonitoredObjectType.JVM_THREAD_INFO);
childNode.setStats(new JVMThreadInfoStatsImpl(info));
childNode.setStatsClass(com.sun.enterprise.admin.monitor.stats.JVMThreadInfoStats.class);
childNode.setDottedName(DottedNameFactory.getJVMThreadInfoDottedName(threadName));
childNode.setObjectName(MonitoringObjectNames.getJVMThreadInfoObjectName(threadName));
childNode.registerMBean();
}
}