/[classpath]/classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java
ViewVC logotype

Diff of /classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by gnu_andrew, Tue Aug 2 20:12:08 2005 UTC revision 1.1.2.2 by gnu_andrew, Sat Sep 10 15:31:36 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39    
40  package gnu.classpath.jdwp.processor;  package gnu.classpath.jdwp.processor;
41    
 import gnu.classpath.jdwp.Jdwp;  
42  import gnu.classpath.jdwp.JdwpConstants;  import gnu.classpath.jdwp.JdwpConstants;
43  import gnu.classpath.jdwp.exception.JdwpException;  import gnu.classpath.jdwp.exception.JdwpException;
44  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
45  import gnu.classpath.jdwp.exception.NotImplementedException;  import gnu.classpath.jdwp.exception.NotImplementedException;
 import gnu.classpath.jdwp.id.IdManager;  
46  import gnu.classpath.jdwp.id.ObjectId;  import gnu.classpath.jdwp.id.ObjectId;
47  import gnu.classpath.jdwp.util.JdwpString;  import gnu.classpath.jdwp.util.JdwpString;
48    
# Line 57  import java.nio.ByteBuffer; Line 55  import java.nio.ByteBuffer;
55   *   *
56   * @author Aaron Luchko <aluchko@redhat.com>   * @author Aaron Luchko <aluchko@redhat.com>
57   */   */
58  public class ThreadGroupReferenceCommandSet implements CommandSet  public class ThreadGroupReferenceCommandSet
59      extends CommandSet
60  {  {
   // Manages all the different ids that are assigned by jdwp  
   private final IdManager idMan = Jdwp.getIdManager();  
   
61    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
62      throws JdwpException      throws JdwpException
63    {    {
# Line 95  public class ThreadGroupReferenceCommand Line 91  public class ThreadGroupReferenceCommand
91    private void executeName(ByteBuffer bb, DataOutputStream os)    private void executeName(ByteBuffer bb, DataOutputStream os)
92      throws JdwpException, IOException      throws JdwpException, IOException
93    {    {
94      ObjectId oid = idMan.readId(bb);      ObjectId oid = idMan.readObjectId(bb);
95      ThreadGroup group = (ThreadGroup) oid.getObject();      ThreadGroup group = (ThreadGroup) oid.getObject();
96      JdwpString.writeString(os, group.getName());      JdwpString.writeString(os, group.getName());
97    }    }
# Line 103  public class ThreadGroupReferenceCommand Line 99  public class ThreadGroupReferenceCommand
99    private void executeParent(ByteBuffer bb, DataOutputStream os)    private void executeParent(ByteBuffer bb, DataOutputStream os)
100      throws JdwpException, IOException      throws JdwpException, IOException
101    {    {
102      ObjectId oid = idMan.readId(bb);      ObjectId oid = idMan.readObjectId(bb);
103      ThreadGroup group = (ThreadGroup) oid.getObject();      ThreadGroup group = (ThreadGroup) oid.getObject();
104      ThreadGroup parent = group.getParent();      ThreadGroup parent = group.getParent();
105      ObjectId parentId = idMan.getId(parent);      ObjectId parentId = idMan.getObjectId(parent);
106      parentId.write(os);      parentId.write(os);
107    }    }
108    
109    private void executeChildren(ByteBuffer bb, DataOutputStream os)    private void executeChildren(ByteBuffer bb, DataOutputStream os)
110      throws JdwpException, IOException      throws JdwpException, IOException
111    {    {
112      ObjectId oid = idMan.readId(bb);      ObjectId oid = idMan.readObjectId(bb);
113      ThreadGroup group = (ThreadGroup) oid.getObject();      ThreadGroup group = (ThreadGroup) oid.getObject();
114    
115      ThreadGroup jdwpGroup = Thread.currentThread().getThreadGroup();      ThreadGroup jdwpGroup = Thread.currentThread().getThreadGroup();
# Line 143  public class ThreadGroupReferenceCommand Line 139  public class ThreadGroupReferenceCommand
139          if (thread == null)          if (thread == null)
140            break; // No threads after this point            break; // No threads after this point
141          if (!thread.getThreadGroup().equals(jdwpGroup))          if (!thread.getThreadGroup().equals(jdwpGroup))
142            idMan.getId(thread).write(os);            idMan.getObjectId(thread).write(os);
143        }        }
144    
145      int numGroups = group.activeCount();      int numGroups = group.activeCount();
# Line 172  public class ThreadGroupReferenceCommand Line 168  public class ThreadGroupReferenceCommand
168          if (tgroup == null)          if (tgroup == null)
169            break; // No ThreadGroups after this point            break; // No ThreadGroups after this point
170          if (!tgroup.equals(jdwpGroup))          if (!tgroup.equals(jdwpGroup))
171            idMan.getId(tgroup).write(os);            idMan.getObjectId(tgroup).write(os);
172        }        }
173    }    }
174  }  }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26