Examples of dumpAllThreads()


Examples of java.lang.management.ThreadMXBean.dumpAllThreads()

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

Examples of java.lang.management.ThreadMXBean.dumpAllThreads()

    }

    @IgnoreJRERequirement
    public static ThreadInfo[] getThreadInfos() {
        ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
        return mbean.dumpAllThreads(mbean.isObjectMonitorUsageSupported(),mbean.isSynchronizerUsageSupported());
    }

    public static ThreadGroupMap sortThreadsAndGetGroupMap(ThreadInfo[] list) {
        ThreadGroupMap sorter = new ThreadGroupMap();
        Arrays.sort(list, sorter);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.