KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > jdwp > JdwpCommandPacket


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.jdwp;
12
13
14 import java.io.IOException JavaDoc;
15 import java.lang.reflect.Field JavaDoc;
16 import java.lang.reflect.Modifier JavaDoc;
17 import java.util.HashMap JavaDoc;
18 import java.util.Map JavaDoc;
19
20 /**
21  * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
22  * declared by the JDWP specification.
23  *
24  */

25 public class JdwpCommandPacket extends JdwpPacket {
26     /** Command Sets. */
27     public static final int CSET_VIRTUAL_MACHINE = 1;
28     public static final int CSET_REFERENCE_TYPE = 2;
29     public static final int CSET_CLASS_TYPE = 3;
30     public static final int CSET_ARRAY_TYPE = 4;
31     public static final int CSET_INTERFACE_TYPE = 5;
32     public static final int CSET_METHOD = 6;
33     public static final int CSET_FIELD = 8;
34     public static final int CSET_OBJECT_REFERENCE = 9;
35     public static final int CSET_STRING_REFERENCE = 10;
36     public static final int CSET_THREAD_REFERENCE = 11;
37     public static final int CSET_THREAD_GROUP_REFERENCE = 12;
38     public static final int CSET_ARRAY_REFERENCE = 13;
39     public static final int CSET_CLASS_LOADER_REFERENCE = 14;
40     public static final int CSET_EVENT_REQUEST = 15;
41     public static final int CSET_STACK_FRAME = 16;
42     public static final int CSET_CLASS_OBJECT_REFERENCE = 17;
43     public static final int CSET_EVENT = 64;
44     public static final int CSET_HOT_CODE_REPLACEMENT = 128;
45
46     /** Commands VirtualMachine. */
47     public static final int VM_VERSION = 1 + (CSET_VIRTUAL_MACHINE << 8);
48     public static final int VM_CLASSES_BY_SIGNATURE = 2 + (CSET_VIRTUAL_MACHINE << 8);
49     public static final int VM_ALL_CLASSES = 3 + (CSET_VIRTUAL_MACHINE << 8);
50     public static final int VM_ALL_THREADS = 4 + (CSET_VIRTUAL_MACHINE << 8);
51     public static final int VM_TOP_LEVEL_THREAD_GROUPS = 5 + (CSET_VIRTUAL_MACHINE << 8);
52     public static final int VM_DISPOSE = 6 + (CSET_VIRTUAL_MACHINE << 8);
53     public static final int VM_ID_SIZES = 7 + (CSET_VIRTUAL_MACHINE << 8);
54     public static final int VM_SUSPEND = 8 + (CSET_VIRTUAL_MACHINE << 8);
55     public static final int VM_RESUME = 9 + (CSET_VIRTUAL_MACHINE << 8);
56     public static final int VM_EXIT = 10 + (CSET_VIRTUAL_MACHINE << 8);
57     public static final int VM_CREATE_STRING = 11 + (CSET_VIRTUAL_MACHINE << 8);
58     public static final int VM_CAPABILITIES = 12 + (CSET_VIRTUAL_MACHINE << 8);
59     public static final int VM_CLASS_PATHS = 13 + (CSET_VIRTUAL_MACHINE << 8);
60     public static final int VM_DISPOSE_OBJECTS = 14 + (CSET_VIRTUAL_MACHINE << 8);
61     public static final int VM_HOLD_EVENTS = 15 + (CSET_VIRTUAL_MACHINE << 8);
62     public static final int VM_RELEASE_EVENTS = 16 + (CSET_VIRTUAL_MACHINE << 8);
63     public static final int VM_CAPABILITIES_NEW = 17 + (CSET_VIRTUAL_MACHINE << 8);
64     public static final int VM_REDEFINE_CLASSES = 18 + (CSET_VIRTUAL_MACHINE << 8);
65     public static final int VM_SET_DEFAULT_STRATUM = 19 + (CSET_VIRTUAL_MACHINE << 8);
66     public static final int VM_ALL_CLASSES_WITH_GENERIC= 20 + (CSET_VIRTUAL_MACHINE << 8);
67     public static final int VM_INSTANCE_COUNTS = 21 + (CSET_VIRTUAL_MACHINE << 8);
68
69     /** Commands ReferenceType. */
70     public static final int RT_SIGNATURE = 1 + (CSET_REFERENCE_TYPE << 8);
71     public static final int RT_CLASS_LOADER = 2 + (CSET_REFERENCE_TYPE << 8);
72     public static final int RT_MODIFIERS = 3 + (CSET_REFERENCE_TYPE << 8);
73     public static final int RT_FIELDS = 4 + (CSET_REFERENCE_TYPE << 8);
74     public static final int RT_METHODS = 5 + (CSET_REFERENCE_TYPE << 8);
75     public static final int RT_GET_VALUES = 6 + (CSET_REFERENCE_TYPE << 8);
76     public static final int RT_SOURCE_FILE = 7 + (CSET_REFERENCE_TYPE << 8);
77     public static final int RT_NESTED_TYPES = 8 + (CSET_REFERENCE_TYPE << 8);
78     public static final int RT_STATUS = 9 + (CSET_REFERENCE_TYPE << 8);
79     public static final int RT_INTERFACES = 10 + (CSET_REFERENCE_TYPE << 8);
80     public static final int RT_CLASS_OBJECT = 11 + (CSET_REFERENCE_TYPE << 8);
81     public static final int RT_SOURCE_DEBUG_EXTENSION = 12 + (CSET_REFERENCE_TYPE << 8);
82     public static final int RT_SIGNATURE_WITH_GENERIC = 13 + (CSET_REFERENCE_TYPE << 8);
83     public static final int RT_FIELDS_WITH_GENERIC = 14 + (CSET_REFERENCE_TYPE << 8);
84     public static final int RT_METHODS_WITH_GENERIC = 15 + (CSET_REFERENCE_TYPE << 8);
85     public static final int RT_INSTANCES = 16 + (CSET_REFERENCE_TYPE << 8);
86     public static final int RT_CLASS_VERSION = 17 + (CSET_REFERENCE_TYPE << 8);
87     public static final int RT_CONSTANT_POOL = 18 + (CSET_REFERENCE_TYPE << 8);
88
89     /** Commands ClassType. */
90     public static final int CT_SUPERCLASS = 1 + (CSET_CLASS_TYPE << 8);
91     public static final int CT_SET_VALUES = 2 + (CSET_CLASS_TYPE << 8);
92     public static final int CT_INVOKE_METHOD = 3 + (CSET_CLASS_TYPE << 8);
93     public static final int CT_NEW_INSTANCE = 4 + (CSET_CLASS_TYPE << 8);
94
95     /** Commands ArrayType. */
96     public static final int AT_NEW_INSTANCE = 1 + (CSET_ARRAY_TYPE << 8);
97
98     /** Commands Method. */
99     public static final int M_LINE_TABLE = 1 + (CSET_METHOD << 8);
100     public static final int M_VARIABLE_TABLE = 2 + (CSET_METHOD << 8);
101     public static final int M_BYTECODES = 3 + (CSET_METHOD << 8);
102     public static final int M_OBSOLETE = 4 + (CSET_METHOD << 8);
103     public static final int M_VARIABLE_TABLE_WITH_GENERIC = 5 + (CSET_METHOD << 8);
104
105     /** Commands ObjectReference. */
106     public static final int OR_REFERENCE_TYPE = 1 + (CSET_OBJECT_REFERENCE << 8);
107     public static final int OR_GET_VALUES = 2 + (CSET_OBJECT_REFERENCE << 8);
108     public static final int OR_SET_VALUES = 3 + (CSET_OBJECT_REFERENCE << 8);
109     public static final int OR_MONITOR_INFO = 5 + (CSET_OBJECT_REFERENCE << 8);
110     public static final int OR_INVOKE_METHOD = 6 + (CSET_OBJECT_REFERENCE << 8);
111     public static final int OR_DISABLE_COLLECTION = 7 + (CSET_OBJECT_REFERENCE << 8);
112     public static final int OR_ENABLE_COLLECTION = 8 + (CSET_OBJECT_REFERENCE << 8);
113     public static final int OR_IS_COLLECTED = 9 + (CSET_OBJECT_REFERENCE << 8);
114     public static final int OR_REFERRING_OBJECTS = 10 + (CSET_OBJECT_REFERENCE << 8);
115
116     /** Commands StringReference. */
117     public static final int SR_VALUE = 1 + (CSET_STRING_REFERENCE << 8);
118
119     /** Commands ThreadReference. */
120     public static final int TR_NAME = 1 + (CSET_THREAD_REFERENCE << 8);
121     public static final int TR_SUSPEND = 2 + (CSET_THREAD_REFERENCE << 8);
122     public static final int TR_RESUME = 3 + (CSET_THREAD_REFERENCE << 8);
123     public static final int TR_STATUS = 4 + (CSET_THREAD_REFERENCE << 8);
124     public static final int TR_THREAD_GROUP = 5 + (CSET_THREAD_REFERENCE << 8);
125     public static final int TR_FRAMES = 6 + (CSET_THREAD_REFERENCE << 8);
126     public static final int TR_FRAME_COUNT = 7 + (CSET_THREAD_REFERENCE << 8);
127     public static final int TR_OWNED_MONITORS = 8 + (CSET_THREAD_REFERENCE << 8);
128     public static final int TR_CURRENT_CONTENDED_MONITOR = 9 + (CSET_THREAD_REFERENCE << 8);
129     public static final int TR_STOP = 10 + (CSET_THREAD_REFERENCE << 8);
130     public static final int TR_INTERRUPT = 11 + (CSET_THREAD_REFERENCE << 8);
131     public static final int TR_SUSPEND_COUNT = 12 + (CSET_THREAD_REFERENCE << 8);
132     public static final int TR_OWNED_MONITOR_STACK_DEPTH = 13 + (CSET_THREAD_REFERENCE << 8);
133     public static final int TR_FORCE_EARLY_RETURN = 14 + (CSET_THREAD_REFERENCE << 8);
134
135     /** Commands ThreadGroupReference. */
136     public static final int TGR_NAME = 1 + (CSET_THREAD_GROUP_REFERENCE << 8);
137     public static final int TGR_PARENT = 2 + (CSET_THREAD_GROUP_REFERENCE << 8);
138     public static final int TGR_CHILDREN = 3 + (CSET_THREAD_GROUP_REFERENCE << 8);
139
140     /** Commands ArrayReference. */
141     public static final int AR_LENGTH = 1 + (CSET_ARRAY_REFERENCE << 8);
142     public static final int AR_GET_VALUES = 2 + (CSET_ARRAY_REFERENCE << 8);
143     public static final int AR_SET_VALUES = 3 + (CSET_ARRAY_REFERENCE << 8);
144
145     /** Commands ClassLoaderReference. */
146     public static final int CLR_VISIBLE_CLASSES = 1 + (CSET_CLASS_LOADER_REFERENCE << 8);
147
148     /** Commands EventRequest. */
149     public static final int ER_SET = 1 + (CSET_EVENT_REQUEST << 8);
150     public static final int ER_CLEAR = 2 + (CSET_EVENT_REQUEST << 8);
151     public static final int ER_CLEAR_ALL_BREAKPOINTS = 3 + (CSET_EVENT_REQUEST << 8);
152
153     /** Commands StackFrame. */
154     public static final int SF_GET_VALUES = 1 + (CSET_STACK_FRAME << 8);
155     public static final int SF_SET_VALUES = 2 + (CSET_STACK_FRAME << 8);
156     public static final int SF_THIS_OBJECT = 3 + (CSET_STACK_FRAME << 8);
157     public static final int SF_POP_FRAME = 4 + (CSET_STACK_FRAME << 8);
158
159     /** Commands ClassObjectReference. */
160     public static final int COR_REFLECTED_TYPE = 1 + (CSET_CLASS_OBJECT_REFERENCE << 8);
161
162     /** Commands Event. */
163     public static final int E_COMPOSITE = 100 + (CSET_EVENT << 8);
164
165     /** Commands Hot Code Replacement (OTI specific). */
166     public static final int HCR_CLASSES_HAVE_CHANGED = 1 + (CSET_HOT_CODE_REPLACEMENT << 8);
167     public static final int HCR_GET_CLASS_VERSION = 2 + (CSET_HOT_CODE_REPLACEMENT << 8);
168     public static final int HCR_DO_RETURN = 3 + (CSET_HOT_CODE_REPLACEMENT << 8);
169     public static final int HCR_REENTER_ON_EXIT = 4 + (CSET_HOT_CODE_REPLACEMENT << 8);
170     public static final int HCR_CAPABILITIES = 5 + (CSET_HOT_CODE_REPLACEMENT << 8);
171
172     /** Mapping of command codes to strings. */
173     private static Map JavaDoc fgCommandMap = null;
174
175     /** Next id to be assigned. */
176     private static int fgNextId = 1;
177     /** Command, note that this field is 256 * JDWP CommandSet (unsigned) + JDWP Command. */
178     private int fCommand;
179
180     /**
181      * Creates new JdwpCommandPacket.
182      */

183     protected JdwpCommandPacket() {
184     }
185
186     /**
187      * Creates new JdwpCommandPacket.
188      */

189     public JdwpCommandPacket(int command) {
190         setCommand(command);
191         setId(getNewId());
192     }
193     
194     /**
195      * @return Returns unique id for command packet.
196      */

197     public static synchronized int getNewId() {
198         return fgNextId++;
199     }
200
201     /**
202      * @return Returns JDWP command set of packet.
203      */

204     public byte getCommandSet() {
205         return (byte)(fCommand >>> 8);
206     }
207
208     /**
209      * @return Returns 256 * JDWP CommandSet (unsigned) + JDWP Command.
210      */

211     public int getCommand() {
212         return fCommand;
213     }
214     
215     /**
216      * Assigns command (256 * JDWP CommandSet (unsigned) + JDWP Command)
217      */

218     public void setCommand(int command) {
219         fCommand = command;
220     }
221     
222     /**
223      * Reads header fields that are specific for this type of packet.
224      */

225     protected int readSpecificHeaderFields(byte[] bytes, int index) {
226         byte commandSet = bytes[index];
227         fCommand = bytes[index+1] + (commandSet << 8);
228         return 2;
229     }
230
231     /**
232      * Writes header fields that are specific for this type of packet.
233      */

234     protected int writeSpecificHeaderFields(byte[] bytes, int index) throws IOException JavaDoc {
235         bytes[index] = getCommandSet();
236         bytes[index+1] = (byte) fCommand;
237         return 2;
238     }
239     
240     /**
241      * Retrieves constant mappings.
242      */

243     public static void getConstantMaps() {
244         if (fgCommandMap != null) {
245             return;
246         }
247         
248         Field JavaDoc[] fields = JdwpCommandPacket.class.getDeclaredFields();
249         
250         // First get the set names.
251
Map JavaDoc setNames = new HashMap JavaDoc(fields.length);
252         for (int i = 0; i < fields.length; i++) {
253             Field JavaDoc field = fields[i];
254             if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
255                 continue;
256
257             try {
258                 String JavaDoc name = field.getName();
259                 // If it is not a set, continue.
260
if (!name.startsWith("CSET_")) {//$NON-NLS-1$
261
continue;
262                 }
263                 int value = field.getInt(null);
264                 setNames.put(new Integer JavaDoc(value), removePrefix(name));
265             } catch (IllegalAccessException JavaDoc e) {
266                 // Will not occur for own class.
267
} catch (IllegalArgumentException JavaDoc e) {
268                 // Should not occur.
269
// We should take care that all public static final constants
270
// in this class are numbers that are convertible to int.
271
}
272         }
273         
274         // Get the commands.
275
fgCommandMap = new HashMap JavaDoc();
276         for (int i = 0; i < fields.length; i++) {
277             Field JavaDoc field = fields[i];
278             if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
279                 continue;
280             }
281                 
282             try {
283                 String JavaDoc name = field.getName();
284                 
285                 // If it is a set, continue.
286
if (name.startsWith("CSET_")) { //$NON-NLS-1$
287
continue;
288                 }
289                 Integer JavaDoc val = (Integer JavaDoc)field.get(null);
290                 int value = val.intValue();
291                 int set = value >>> 8;
292                 String JavaDoc setName = (String JavaDoc)setNames.get(new Integer JavaDoc(set));
293                 String JavaDoc entryName = setName + " - " + removePrefix(name); //$NON-NLS-1$
294

295                 fgCommandMap.put(val, entryName);
296                 
297             } catch (IllegalAccessException JavaDoc e) {
298                 // Will not occur for own class.
299
}
300         }
301     }
302
303     /**
304      * @return Returns a map with string representations of error codes.
305      */

306     public static Map JavaDoc commandMap() {
307         getConstantMaps();
308         return fgCommandMap;
309     }
310     
311     /**
312      * @return Returns string without XXX_ prefix.
313      */

314     public static String JavaDoc removePrefix(String JavaDoc str) {
315         int i = str.indexOf('_');
316         if (i < 0) {
317             return str;
318         }
319         return str.substring(i + 1);
320     }
321     
322     /* (non-Javadoc)
323      * @see java.lang.Object#toString()
324      */

325     public String JavaDoc toString() {
326         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
327         buffer.append('[');
328         buffer.append(getId());
329         buffer.append("] "); //$NON-NLS-1$
330
switch (getCommand()) {
331         
332             /** Commands VirtualMachine. */
333             case VM_VERSION:
334                 buffer.append("VM_VERSION"); //$NON-NLS-1$
335
break;
336             case VM_CLASSES_BY_SIGNATURE:
337                 buffer.append("VM_CLASSES_BY_SIGNATURE"); //$NON-NLS-1$
338
break;
339             case VM_ALL_CLASSES:
340                 buffer.append("VM_ALL_CLASSES"); //$NON-NLS-1$
341
break;
342             case VM_ALL_THREADS:
343                 buffer.append("VM_ALL_THREADS"); //$NON-NLS-1$
344
break;
345             case VM_TOP_LEVEL_THREAD_GROUPS:
346                 buffer.append("VM_TOP_LEVEL_THREAD_GROUPS"); //$NON-NLS-1$
347
break;
348             case VM_DISPOSE:
349                 buffer.append("VM_DISPOSE"); //$NON-NLS-1$
350
break;
351             case VM_ID_SIZES:
352                 buffer.append("VM_ID_SIZES"); //$NON-NLS-1$
353
break;
354             case VM_SUSPEND:
355                 buffer.append("VM_SUSPEND"); //$NON-NLS-1$
356
break;
357             case VM_RESUME:
358                 buffer.append("VM_RESUME"); //$NON-NLS-1$
359
break;
360             case VM_EXIT:
361                 buffer.append("VM_EXIT"); //$NON-NLS-1$
362
break;
363             case VM_CREATE_STRING:
364                 buffer.append("VM_CREATE_STRING"); //$NON-NLS-1$
365
break;
366             case VM_CAPABILITIES:
367                 buffer.append("VM_CAPABILITIES"); //$NON-NLS-1$
368
break;
369             case VM_CLASS_PATHS:
370                 buffer.append("VM_CLASS_PATHS"); //$NON-NLS-1$
371
break;
372             case VM_DISPOSE_OBJECTS:
373                 buffer.append("VM_DISPOSE_OBJECTS"); //$NON-NLS-1$
374
break;
375             case VM_HOLD_EVENTS:
376                 buffer.append("VM_HOLD_EVENTS"); //$NON-NLS-1$
377
break;
378             case VM_RELEASE_EVENTS:
379                 buffer.append("VM_RELEASE_EVENTS"); //$NON-NLS-1$
380
break;
381             case VM_CAPABILITIES_NEW:
382                 buffer.append("VM_CAPABILITIES_NEW"); //$NON-NLS-1$
383
break;
384             case VM_REDEFINE_CLASSES:
385                 buffer.append("VM_REDEFINE_CLASSES"); //$NON-NLS-1$
386
break;
387             case VM_SET_DEFAULT_STRATUM:
388                 buffer.append("VM_SET_DEFAULT_STRATUM"); //$NON-NLS-1$
389
break;
390             case VM_ALL_CLASSES_WITH_GENERIC:
391                 buffer.append("VM_ALL_CLASSES_WITH_GENERIC"); //$NON-NLS-1$
392
break;
393                 
394             /** Commands ReferenceType. */
395             case RT_SIGNATURE:
396                 buffer.append("RT_SIGNATURE"); //$NON-NLS-1$
397
break;
398             case RT_CLASS_LOADER:
399                 buffer.append("RT_CLASS_LOADER"); //$NON-NLS-1$
400
break;
401             case RT_MODIFIERS:
402                 buffer.append("RT_MODIFIERS"); //$NON-NLS-1$
403
break;
404             case RT_FIELDS:
405                 buffer.append("RT_FIELDS"); //$NON-NLS-1$
406
break;
407             case RT_METHODS:
408                 buffer.append("RT_METHODS"); //$NON-NLS-1$
409
break;
410             case RT_GET_VALUES:
411                 buffer.append("RT_GET_VALUES"); //$NON-NLS-1$
412
break;
413             case RT_SOURCE_FILE:
414                 buffer.append("RT_SOURCE_FILE"); //$NON-NLS-1$
415
break;
416             case RT_NESTED_TYPES:
417                 buffer.append("RT_NESTED_TYPES"); //$NON-NLS-1$
418
break;
419             case RT_STATUS:
420                 buffer.append("RT_STATUS"); //$NON-NLS-1$
421
break;
422             case RT_INTERFACES:
423                 buffer.append("RT_INTERFACES"); //$NON-NLS-1$
424
break;
425             case RT_CLASS_OBJECT:
426                 buffer.append("RT_CLASS_OBJECT"); //$NON-NLS-1$
427
break;
428             case RT_SOURCE_DEBUG_EXTENSION:
429                 buffer.append("RT_SOURCE_DEBUG_EXTENSION"); //$NON-NLS-1$
430
break;
431             case RT_SIGNATURE_WITH_GENERIC:
432                 buffer.append("RT_SIGNATURE_WITH_GENERIC"); //$NON-NLS-1$
433
break;
434             case RT_FIELDS_WITH_GENERIC:
435                 buffer.append("RT_FIELDS_WITH_GENERIC"); //$NON-NLS-1$
436
break;
437             case RT_METHODS_WITH_GENERIC:
438                 buffer.append("RT_METHODS_WITH_GENERIC"); //$NON-NLS-1$
439
break;
440                 
441             /** Commands ClassType. */
442             case CT_SUPERCLASS:
443                 buffer.append("CT_SUPERCLASS"); //$NON-NLS-1$
444
break;
445             case CT_SET_VALUES:
446                 buffer.append("CT_SET_VALUES"); //$NON-NLS-1$
447
break;
448             case CT_INVOKE_METHOD:
449                 buffer.append("CT_INVOKE_METHOD"); //$NON-NLS-1$
450
break;
451             case CT_NEW_INSTANCE:
452                 buffer.append("CT_NEW_INSTANCE"); //$NON-NLS-1$
453
break;
454
455             /** Commands ArrayType. */
456             case AT_NEW_INSTANCE:
457                 buffer.append("AT_NEW_INSTANCE"); //$NON-NLS-1$
458
break;
459
460             /** Commands Method. */
461             case M_LINE_TABLE:
462                 buffer.append("M_LINE_TABLE"); //$NON-NLS-1$
463
break;
464             case M_VARIABLE_TABLE:
465                 buffer.append("M_VARIABLE_TABLE"); //$NON-NLS-1$
466
break;
467             case M_BYTECODES:
468                 buffer.append("M_BYTECODES"); //$NON-NLS-1$
469
break;
470             case M_OBSOLETE:
471                 buffer.append("M_OBSOLETE"); //$NON-NLS-1$
472
break;
473             case M_VARIABLE_TABLE_WITH_GENERIC:
474                 buffer.append("M_VARIABLE_TABLE_WITH_GENERIC"); //$NON-NLS-1$
475
break;
476
477             /** Commands ObjectReference. */
478             case OR_REFERENCE_TYPE:
479                 buffer.append("OR_REFERENCE_TYPE"); //$NON-NLS-1$
480
break;
481             case OR_GET_VALUES:
482                 buffer.append("OR_GET_VALUES"); //$NON-NLS-1$
483
break;
484             case OR_SET_VALUES:
485                 buffer.append("OR_SET_VALUES"); //$NON-NLS-1$
486
break;
487             case OR_MONITOR_INFO:
488                 buffer.append("OR_MONITOR_INFO"); //$NON-NLS-1$
489
break;
490             case OR_INVOKE_METHOD:
491                 buffer.append("OR_INVOKE_METHOD"); //$NON-NLS-1$
492
break;
493             case OR_DISABLE_COLLECTION:
494                 buffer.append("OR_DISABLE_COLLECTION"); //$NON-NLS-1$
495
break;
496             case OR_ENABLE_COLLECTION:
497                 buffer.append("OR_ENABLE_COLLECTION"); //$NON-NLS-1$
498
break;
499             case OR_IS_COLLECTED:
500                 buffer.append("OR_IS_COLLECTED"); //$NON-NLS-1$
501
break;
502
503             /** Commands StringReference. */
504             case SR_VALUE:
505                 buffer.append("SR_VALUE"); //$NON-NLS-1$
506
break;
507
508             /** Commands ThreadReference. */
509             case TR_NAME:
510                 buffer.append("TR_NAME"); //$NON-NLS-1$
511
break;
512             case TR_SUSPEND:
513                 buffer.append("TR_SUSPEND"); //$NON-NLS-1$
514
break;
515             case TR_RESUME:
516                 buffer.append("TR_RESUME"); //$NON-NLS-1$
517
break;
518             case TR_STATUS:
519                 buffer.append("TR_STATUS"); //$NON-NLS-1$
520
break;
521             case TR_THREAD_GROUP:
522                 buffer.append("TR_THREAD_GROUP"); //$NON-NLS-1$
523
break;
524             case TR_FRAMES:
525                 buffer.append("TR_FRAMES"); //$NON-NLS-1$
526
break;
527             case TR_FRAME_COUNT:
528                 buffer.append("TR_FRAME_COUNT"); //$NON-NLS-1$
529
break;
530             case TR_OWNED_MONITORS:
531                 buffer.append("TR_OWNED_MONITORS"); //$NON-NLS-1$
532
break;
533             case TR_CURRENT_CONTENDED_MONITOR:
534                 buffer.append("TR_CURRENT_CONTENDED_MONITOR"); //$NON-NLS-1$
535
break;
536             case TR_STOP:
537                 buffer.append("TR_STOP"); //$NON-NLS-1$
538
break;
539             case TR_INTERRUPT:
540                 buffer.append("TR_INTERRUPT"); //$NON-NLS-1$
541
break;
542             case TR_SUSPEND_COUNT:
543                 buffer.append("TR_SUSPEND_COUNT"); //$NON-NLS-1$
544
break;
545
546             /** Commands ThreadGroupReference. */
547             case TGR_NAME:
548                 buffer.append("TGR_NAME"); //$NON-NLS-1$
549
break;
550             case TGR_PARENT:
551                 buffer.append("TGR_PARENT"); //$NON-NLS-1$
552
break;
553             case TGR_CHILDREN:
554                 buffer.append("TGR_CHILDREN"); //$NON-NLS-1$
555
break;
556
557             /** Commands ArrayReference. */
558             case AR_LENGTH:
559                 buffer.append("AR_LENGTH"); //$NON-NLS-1$
560
break;
561             case AR_GET_VALUES:
562                 buffer.append("AR_GET_VALUES"); //$NON-NLS-1$
563
break;
564             case AR_SET_VALUES:
565                 buffer.append("AR_SET_VALUES"); //$NON-NLS-1$
566
break;
567
568             /** Commands ClassLoaderReference. */
569             case CLR_VISIBLE_CLASSES:
570                 buffer.append("CLR_VISIBLE_CLASSES"); //$NON-NLS-1$
571
break;
572
573             /** Commands EventRequest. */
574             case ER_SET:
575                 buffer.append("ER_SET"); //$NON-NLS-1$
576
break;
577             case ER_CLEAR:
578                 buffer.append("ER_CLEAR"); //$NON-NLS-1$
579
break;
580             case ER_CLEAR_ALL_BREAKPOINTS:
581                 buffer.append("ER_CLEAR_ALL_BREAKPOINTS"); //$NON-NLS-1$
582
break;
583
584             /** Commands StackFrame. */
585             case SF_GET_VALUES:
586                 buffer.append("SF_GET_VALUES"); //$NON-NLS-1$
587
break;
588             case SF_SET_VALUES:
589                 buffer.append("SF_SET_VALUES"); //$NON-NLS-1$
590
break;
591             case SF_THIS_OBJECT:
592                 buffer.append("SF_THIS_OBJECT"); //$NON-NLS-1$
593
break;
594             case SF_POP_FRAME:
595                 buffer.append("SF_POP_FRAME"); //$NON-NLS-1$
596
break;
597
598             /** Commands ClassObjectReference. */
599             case COR_REFLECTED_TYPE:
600                 buffer.append("COR_REFLECTED_TYPE"); //$NON-NLS-1$
601
break;
602                 
603             /** Commands Event. */
604             case E_COMPOSITE:
605                 buffer.append("E_COMPOSITE"); //$NON-NLS-1$
606
break;
607             
608         default:
609             buffer.append("UNKNOWN COMMAND: "); //$NON-NLS-1$
610
buffer.append(getCommand());
611             break;
612         }
613         return buffer.toString();
614     }
615 }
616
Popular Tags