Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / DebugSessionCommand.java
1 package jde.debugger.command;
2
3 import java.util.List;
4
5 import jde.debugger.Etc;
6 import jde.debugger.JDEException;
7 import jde.debugger.JDEbug;
8
9
10 /**
11  * DebugSessionCommand.java
12  *
13  *
14  * Created: Fri Jan 28 21:59:32 2000
15  *
16  * @author Paul Kinnucan
17  * @version $Revision: 1.5 $
18  */
19
20 abstract public class DebugSessionCommand extends DebugCommand {
21   /**
22    * The process (debugger process) ID that this command is 
23    * targeted at.
24    */
25   protected Integer m_targetProcessID;
26     
27   public DebugSessionCommand() { }
28
29   public void init(Integer cmdID, String cmdName, List args) throws JDEException {
30
31     super.init(cmdID, cmdName, args);
32
33     if (cmdName.equals("quit")) return;
34
35     if (args.size() < 1 )
36       throw new JDEException("Missing application ID");
37         
38     // the app id with which it will be known.
39     // note that we remove the arguments as we consume them from the
40     // list.
41     m_targetProcessID = new Integer(Etc.safeGetint(args.remove(0), "target process ID"));
42         
43     // the app id cannot be same as the debugger ID (-1)
44     if (m_targetProcessID.equals(JDEbug.debuggerID)) {
45       throw new JDEException("Invalid Application ID");
46     }
47   }
48 } // DebugSessionCommand
49
50
51 /*
52  * $Log: DebugSessionCommand.java,v $
53  * Revision 1.5  2003/01/15 05:56:26  paulk
54  * Add Petter Mahlen's changes.
55  *
56  * Revision 1.4  2001/03/24 05:42:36  paulk
57  * Updated to reflect reorganization of debugger code.
58  *
59  * Revision 1.3  2000/02/02 06:01:14  paulk
60  * Removed the get connector list code from getConnectors method and
61  * instead made the connector list a static member that is initialized
62  * once per session. Did this because it is suspected that getting the
63  * connector list on the command thread was causing the debugger to hang
64  * on some Windows/NT systems.
65  *
66  * Revision 1.2  2000/02/01 06:02:47  paulk
67  * Added special handling for quit command.
68  *
69  * Revision 1.1  2000/01/30 12:37:44  paulk
70  * Defines debug session commands (e.g., launch, attach, quit, etc.).
71  *
72  */
73
74 // End of DebugSessionCommand.java