List of usage examples for java.lang ThreadGroup toString
public String toString()
From source file:Main.java
public static void main(String[] args) { ThreadGroup group = new ThreadGroup("admin"); Thread t = new Thread(group, "website"); System.out.println("Threadgroup = " + group.getName()); String str = group.toString(); System.out.println(str);//from w w w.j a v a 2 s.c o m }
From source file:Main.java
public static String getThreadTree() { ThreadGroup root = Thread.currentThread().getThreadGroup(); while (root.getParent() != null) { root = root.getParent();//from www . j a v a 2 s . c o m } StringBuffer buffer = new StringBuffer(); buffer.append(root.toString()).append("\r"); visit(root, 1, buffer); return buffer.toString(); }