Example usage for java.lang.management ThreadInfo from

List of usage examples for java.lang.management ThreadInfo from

Introduction

In this page you can find the example usage for java.lang.management ThreadInfo from.

Prototype

public static ThreadInfo from(CompositeData cd) 

Source Link

Document

Returns a ThreadInfo object represented by the given CompositeData .

Usage

From source file:org.nuxeo.connect.tools.report.viewer.ThreadDumpPrinter.java

public Iterator<ThreadInfo> iteratorOf() throws IOException {

    return new Iterator<ThreadInfo>() {

        Iterator<JsonNode> nodes = dump.iterator();

        @Override//www .  j a v  a2 s  . c o  m
        public boolean hasNext() {
            return nodes.hasNext();
        }

        @Override
        public ThreadInfo next() {
            try {
                return ThreadInfo.from((CompositeData) converter.convertToObject(
                        MappedMXBeanType.toOpenType(ThreadInfo.class), nodes.next().toString()));
            } catch (OpenDataException cause) {
                throw new AssertionError("Cannot parse thread info attributes", cause);
            }
        }

    };
}