diff options
author | Keith Seitz <keiths@redhat.com> | 2005-08-25 22:09:48 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2005-08-25 22:09:48 +0000 |
commit | 22856b8f2a463df5d4fabbe7f2758f4c3069b81c (patch) | |
tree | a9e1e0bdd83a92981cfc2de8b2b2c099da10ad14 /gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java | |
parent | 1464bb4c918e172a986f35721aa19c61db3cdaad (diff) | |
download | classpath-22856b8f2a463df5d4fabbe7f2758f4c3069b81c.tar.gz |
* gnu/classpath/jdwp/processor/CommandSet.java (CommandSet): Make
an abstract class.
Add protected variables for VMIdManager and VMVirtualMachine.
(runCommand): Make abstract.
* gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java
(ArrayReferenceCommandSet): Derive from CommandSet instead of
implementing it. Remove private hooks to ID manager and VM.
Update all VMIdManager and EventManager API calls.
* gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java
(ArrayTypeCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java
(ClassLoaderReferenceCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java
(ClassObjectReferenceCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ClassTypeCommandSet.java
(ClassTypeCommandSet): Likewise.
* gnu/classpath/jdwp/processor/EventRequestCommandSet.java
(EventRequestCommandSet): Likewise.
* gnu/classpath/jdwp/processor/FieldCommandSet.java
(FieldCommandSet): Likewise.
* gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java
(InterfaceTypeCommandSet): Likewise.
* gnu/classpath/jdwp/processor/MethodCommandSet.java
(MethodCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
(ObjectReferenceCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
(ReferenceTypeCommandSet): Likewise.
* gnu/classpath/jdwp/processor/StackFrameCommandSet.java
(StackFrameCommandSet): Likewise.
* gnu/classpath/jdwp/processor/StringReferenceCommandSet.java
(StringReferenceCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java
(ThreadGroupReferenceCommandSet.java): Likewise.
* gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
(ThreadReferenceCommandSet): Likewise.
* gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
(VirtualMachineCommandSet): Likewise.
* gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
(executeStatus): Fix constant name.
* gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
(executeDisposeObjects): Don't do anything yet -- this
is unimplemented.
Diffstat (limited to 'gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java')
-rw-r--r-- | gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java b/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java index cb02a5ea8..dbb197c4a 100644 --- a/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java +++ b/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java @@ -40,14 +40,11 @@ exception statement from your version. */ package gnu.classpath.jdwp.processor; import gnu.classpath.jdwp.VMFrame; -import gnu.classpath.jdwp.IVirtualMachine; -import gnu.classpath.jdwp.Jdwp; import gnu.classpath.jdwp.JdwpConstants; import gnu.classpath.jdwp.exception.InvalidObjectException; import gnu.classpath.jdwp.exception.JdwpException; import gnu.classpath.jdwp.exception.JdwpInternalErrorException; import gnu.classpath.jdwp.exception.NotImplementedException; -import gnu.classpath.jdwp.id.IdManager; import gnu.classpath.jdwp.id.ObjectId; import gnu.classpath.jdwp.id.ThreadId; import gnu.classpath.jdwp.util.JdwpString; @@ -63,14 +60,9 @@ import java.util.ArrayList; * * @author Aaron Luchko <aluchko@redhat.com> */ -public class ThreadReferenceCommandSet implements CommandSet +public class ThreadReferenceCommandSet + extends CommandSet { - // Our hook into the jvm - private final IVirtualMachine vm = Jdwp.getIVirtualMachine(); - - // Manages all the different ids that are assigned by jdwp - private final IdManager idMan = Jdwp.getIdManager(); - public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) throws JdwpException { @@ -131,7 +123,7 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeName(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); JdwpString.writeString(os, thread.getName()); } @@ -139,7 +131,7 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeSuspend(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); vm.suspendThread(thread); } @@ -147,7 +139,7 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeResume(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); vm.suspendThread(thread); } @@ -155,11 +147,11 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeStatus(ByteBuffer bb, DataOutputStream os) throws InvalidObjectException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); int threadStatus = vm.getThreadStatus(thread); // There's only one possible SuspendStatus... - int suspendStatus = JdwpConstants.SuspendStatus.SUSPEND_STATUS_SUSPENDED; + int suspendStatus = JdwpConstants.SuspendStatus.SUSPENDED; os.writeInt(threadStatus); os.writeInt(suspendStatus); @@ -168,17 +160,17 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeThreadGroup(ByteBuffer bb, DataOutputStream os) throws InvalidObjectException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); ThreadGroup group = thread.getThreadGroup(); - ObjectId groupId = idMan.getId(group); + ObjectId groupId = idMan.getObjectId(group); groupId.write(os); } private void executeFrames(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); int startFrame = bb.getInt(); int length = bb.getInt(); @@ -197,7 +189,7 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeFrameCount(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); int frameCount = vm.getFrameCount(thread); @@ -226,16 +218,16 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeStop(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); - ObjectId exception = idMan.readId(bb); + ObjectId exception = idMan.readObjectId(bb); vm.stopThread(thread, (Exception) exception.getObject()); } private void executeInterrupt(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); thread.interrupt(); } @@ -243,7 +235,7 @@ public class ThreadReferenceCommandSet implements CommandSet private void executeSuspendCount(ByteBuffer bb, DataOutputStream os) throws JdwpException, IOException { - ThreadId tid = (ThreadId) idMan.readId(bb); + ThreadId tid = (ThreadId) idMan.readObjectId(bb); Thread thread = (Thread) tid.getObject(); int suspendCount = vm.getSuspendCount(thread); os.writeInt(suspendCount); |