Package com.googlecode.psiprobe.model.java

Examples of com.googlecode.psiprobe.model.java.ThreadModel


        Thread[] threads = new Thread[masterGroup.activeCount()];
        int numThreads = masterGroup.enumerate(threads);

        for (int i = 0; i < numThreads; i++) {
            ThreadModel threadModel = new ThreadModel();
            threadModel.setThreadClass(threads[i].getClass().getName());
            threadModel.setName(threads[i].getName());
            threadModel.setPriority(threads[i].getPriority());
            threadModel.setDaemon(threads[i].isDaemon());
            threadModel.setInterrupted(threads[i].isInterrupted());
            if (threads[i].getThreadGroup() != null) {
                threadModel.setGroupName(threads[i].getThreadGroup().getName());
            }
            Object target = Instruments.getField(threads[i], "target");
            if (target != null) {
                threadModel.setRunnableClassName(target.getClass().getName());
            }

            ClassLoader cl = threads[i].getContextClassLoader();
            if (cl != null) {
                if (classLoaderMap != null) {
                    threadModel.setAppName((String) classLoaderMap.get(toUID(cl)));
                }
                threadModel.setClassLoader(toUID(cl));
            }
            threadList.add(threadModel);
        }
        return threadList;
    }
View Full Code Here

TOP

Related Classes of com.googlecode.psiprobe.model.java.ThreadModel

Copyright © 2018 www.massapicom. 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.