protected Object doExecute() throws Exception {
Map<Long, ThreadInfo> threadInfos = new TreeMap<Long, ThreadInfo>();
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
ThreadInfo[] infos;
if (threadMXBean.isObjectMonitorUsageSupported() && threadMXBean.isSynchronizerUsageSupported()) {
infos = threadMXBean.dumpAllThreads(true, true);
} else {
infos = threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds(), Integer.MAX_VALUE);
}
for (ThreadInfo info : infos) {
threadInfos.put(info.getThreadId(), info);