Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / DebugCommandFactory.java
1 package jde.debugger.command;
2
3 import java.util.HashMap;
4 import java.util.List;
5
6 import jde.debugger.JDEException;
7
8
9
10 /**
11  * DebugCommandFactory.java
12  *
13  *
14  * Created: Fri Jan 28 22:04:57 2000
15  *
16  * Copyright (c) 2000, 2001, 2003    Paul Kinnucan
17  *
18  * @author Paul Kinnucan
19  * @version $Revision: 1.10 $
20  */
21
22 public class DebugCommandFactory  {
23
24   protected DebugCommandFactory() {
25     prototypes.put("attach_shmem",         new AttachShmem());
26     prototypes.put("attach_socket",        new AttachSocket());
27     prototypes.put("break",                new Break());
28     prototypes.put("cancel_trace_classes", new CancelTraceClasses());
29     prototypes.put("cancel_trace_methods", new CancelTraceMethods());
30     prototypes.put("cancel_trace_threads", new CancelTraceThreads());
31     prototypes.put("clear",                new Clear());
32     prototypes.put("debug_thread",         new DebugThread()); // XXX - does not appear to be implemented on the lisp side
33     prototypes.put("evaluate",             new EvaluateExpression());
34     prototypes.put("finish",               new Finish());
35     prototypes.put("get_array",            new GetArray());
36     prototypes.put("get_loaded_classes",   new GetLoadedClasses());
37     prototypes.put("get_locals",           new GetLocals());
38     prototypes.put("get_object",           new GetObject());
39     prototypes.put("get_object_monitors",  new GetObjectMonitors());
40     prototypes.put("get_path_information", new GetPathInfo());
41     prototypes.put("get_string",           new GetString());
42     prototypes.put("get_this",             new GetThis());
43     prototypes.put("get_thread",           new GetThread());
44     prototypes.put("get_threads",          new GetThreads());
45     prototypes.put("interrupt",            new Interrupt());
46     prototypes.put("kill_thread",          new KillThread());
47     prototypes.put("launch",               new LaunchApplication());
48     prototypes.put("listen_shmem",         new ListenShmem());
49     prototypes.put("listen_socket",        new ListenSocket());
50     prototypes.put("quit",                 new Quit());
51     prototypes.put("resume",               new Resume());
52     prototypes.put("run",                  new Run());
53     prototypes.put("stack_frame",          new NullCommand());
54     prototypes.put("step",                 new Step());
55     prototypes.put("suspend",              new Suspend());
56     prototypes.put("trace_classes",        new TraceClasses());
57     prototypes.put("trace_exceptions",     new TraceExceptions());
58     prototypes.put("trace_methods",        new TraceMethods());
59     prototypes.put("trace_threads",        new TraceThreads());
60     prototypes.put("watch",                new Watch());
61   }
62
63   public final DebugCommand createCommand(Integer cmdID,
64                                           String  cmdName,
65                                           List    args)
66     throws JDEException {
67
68     DebugCommand prototype = (DebugCommand) prototypes.get(cmdName);
69
70     if (prototype == null) return null;
71
72     DebugCommand cmd = (DebugCommand) prototype.clone();
73     cmd.init(cmdID, cmdName, args);
74
75     return cmd;
76   }
77
78   private HashMap prototypes = new HashMap();
79
80   public static DebugCommandFactory theFactory = new DebugCommandFactory();
81
82 } // DebugCommandFactory
83
84
85 /*
86  * $Log: DebugCommandFactory.java,v $
87  * Revision 1.10  2003/04/29 16:52:09  troy
88  * Initial version of GUI.  Includes display of local variables.
89  *
90  * Revision 1.9  2003/01/15 05:56:26  paulk
91  * Add Petter Mahlen's changes.
92  *
93  * Revision 1.8  2001/07/06 02:05:51  paulk
94  * Makefile
95  *
96  * Revision 1.7  2001/03/24 05:42:36  paulk
97  * Updated to reflect reorganization of debugger code.
98  *
99  * Revision 1.6  2000/10/20 04:19:00  paulk
100  * *** empty log message ***
101  *
102  * Revision 1.5  2000/07/28 06:27:02  paulk
103  * Committing all modified files.
104  *
105  * Revision 1.4  2000/04/10 05:36:50  paulk
106  * Added get_locals and get_this commands.
107  *
108  * Revision 1.3  2000/03/03 07:40:32  paulk
109  * Converted get_string and get_array commands from functions to objects.
110  *
111  * Revision 1.2  2000/01/31 12:41:45  paulk
112  * * Continue converting commands from functional to OO implementation.
113  *
114  * Revision 1.1  2000/01/30 12:35:20  paulk
115  * Creates debugger commands.
116  *
117  */
118
119 // End of DebugCommandFactory.java