1 22 23 package org.aspectj.debugger.request; 24 25 import org.aspectj.debugger.base.*; 26 27 import com.sun.jdi.*; 28 import java.util.*; 29 30 38 39 public class ThreadGroupsRequest extends Request { 40 public ThreadGroupsRequest (Debugger debugger) { 41 super(debugger); 42 } 43 44 public Object go() throws NoVMException, DebuggerException { 45 List threadGroups = new ArrayList(); 46 getThreadGroups(vm().topLevelThreadGroups(), threadGroups); 47 return threadGroups; 48 } 49 50 private void getThreadGroups(List newGroups, List threadGroups) 51 throws NoVMException, DebuggerException { 52 threadGroups.addAll(newGroups); 53 Iterator iter = newGroups.iterator(); 54 while (iter.hasNext()) { 55 ThreadGroupReference groupRef = (ThreadGroupReference) iter.next(); 56 getThreadGroups(groupRef.threadGroups(), threadGroups); 57 } 58 } 59 } 60 | Popular Tags |