for (int i = 0; i < allIds.length; i++) {
CompositeData cd = (CompositeData) mBeanServer.invoke(threadingOName, "getThreadInfo",
new Object[]{new Long(allIds[i]), new Integer(executionStackDepth)}, new String[]{"long", "int"});
if (cd != null) {
SunThread st = new SunThread();
st.setId(JmxTools.getLongAttr(cd, "threadId"));
st.setName(JmxTools.getStringAttr(cd, "threadName"));
st.setState(JmxTools.getStringAttr(cd, "threadState"));
st.setSuspended(JmxTools.getBooleanAttr(cd, "suspended"));
st.setInNative(JmxTools.getBooleanAttr(cd, "inNative"));
st.setLockName(JmxTools.getStringAttr(cd, "lockName"));
st.setLockOwnerName(JmxTools.getStringAttr(cd, "lockOwnerName"));
st.setWaitedCount(JmxTools.getLongAttr(cd, "waitedCount"));
st.setBlockedCount(JmxTools.getLongAttr(cd, "blockedCount"));
st.setDeadlocked(contains(deadlockedIds, st.getId()));
CompositeData[] stack = (CompositeData[]) cd.get("stackTrace");
if (stack.length > 0) {
CompositeData cd2 = stack[0];
ThreadStackElement tse = new ThreadStackElement();
tse.setClassName(JmxTools.getStringAttr(cd2, "className"));
tse.setFileName(JmxTools.getStringAttr(cd2, "fileName"));
tse.setMethodName(JmxTools.getStringAttr(cd2, "methodName"));
tse.setLineNumber(JmxTools.getIntAttr(cd2, "lineNumber", -1));
tse.setNativeMethod(JmxTools.getBooleanAttr(cd2, "nativeMethod"));
st.setExecutionPoint(tse);
}
threads.add(st);
}
}