1 package jde.debugger.command;
3 import java.util.Iterator;
5 import com.sun.jdi.ObjectReference;
6 import com.sun.jdi.ThreadGroupReference;
7 import com.sun.jdi.ThreadReference;
8 import jde.debugger.Etc;
9 import jde.debugger.JDEException;
13 * 'interrupt' command.
18 * interrupt [threadID]+
23 * <li> threadID can be retrieved using the get_threads command
24 * <li> at least one threadId should be specified
27 * @author Paul Kinnucan
28 * @version $Revision: 1.2 $
29 * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
32 public class Interrupt extends DebugProcessCommand {
36 * @exception jde.debugger.JDEException <description>
38 public void doCommand() throws JDEException {
39 if (m_args.size() < 1)
40 throw new JDEException("Insufficient arguments");
42 Iterator it = m_args.iterator();
43 while (it.hasNext()) {
44 Long uniqueID = Etc.safeGetLong(it.next(), "thread ID");
46 ObjectReference oRef = (ObjectReference) m_debugger.getStore().get(uniqueID);
48 throw new JDEException("Invalid ThreadID, or the thread is dead");
49 } else if (oRef instanceof ThreadReference) {
50 ((ThreadReference) oRef).interrupt();
52 throw new JDEException("The object is not a thread");
55 m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
58 public Object clone() {return new Interrupt();}
63 * $Log: Interrupt.java,v $
64 * Revision 1.2 2003/01/15 05:56:26 paulk
65 * Add Petter Mahlen's changes.
67 * Revision 1.1 2001/03/24 13:35:25 paulk
73 // End of Interrupt.java