KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > bsf > debug > util > DebugConstants


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2002 The Apache Software Foundation. All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * 3. The end-user documentation included with the redistribution, if
20  * any, must include the following acknowlegement:
21  * "This product includes software developed by the
22  * Apache Software Foundation (http://www.apache.org/)."
23  * Alternately, this acknowlegement may appear in the software itself,
24  * if and wherever such third-party acknowlegements normally appear.
25  *
26  * 4. The names "Apache BSF", "Apache", and "Apache Software Foundation"
27  * must not be used to endorse or promote products derived from
28  * this software without prior written permission. For written
29  * permission, please contact apache@apache.org.
30  *
31  * 5. Products derived from this software may not be called "Apache"
32  * nor may "Apache" appear in their names without prior written
33  * permission of the Apache Group.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many individuals
50  * on behalf of the Apache Software Foundation and was originally created by
51  * Sanjiva Weerawarana and others at International Business Machines
52  * Corporation. For more information on the Apache Software Foundation,
53  * please see <http://www.apache.org/>.
54  */

55
56 package org.apache.bsf.debug.util;
57
58 public class DebugConstants {
59
60     ////////////////////////////////////////////////
61

62     public static final int BSF_DEBUG_SERVER_PORT = 4444;
63
64     ////////////////////////////////////////////////
65

66     public static final int BSF_DEBUG_PROTOCOL_MAJOR = 1;
67     public static final int BSF_DEBUG_PROTOCOL_MINOR = 0;
68     public static final int BSF_DEBUG_PROTOCOL_ACCEPT = 1;
69     public static final int BSF_DEBUG_PROTOCOL_REJECT = 0;
70
71     ////////////////////////////////////////////////
72
public static final int WAIT_FOR_VOID = 50;
73     public static final int WAIT_FOR_BOOLEAN= 51;
74     public static final int WAIT_FOR_INT = 52;
75     public static final int WAIT_FOR_LONG = 53;
76     public static final int WAIT_FOR_FLOAT = 54;
77     public static final int WAIT_FOR_DOUBLE = 55;
78     public static final int WAIT_FOR_OBJECT = 56;
79     public static final int WAIT_FOR_MIRROR = 57;
80
81
82     ////////////////////////////////////////////////
83

84     public static final int NULLTID = 1;
85     public static final int NULLUID = 2;
86     
87     public static final int UNKNOWN_TID = 3;
88     public static final int UNKNOWN_UID = 4;
89     
90     public static final int SPECIAL_TID = 5;
91     public static final int NOT_FOUND_UID = 6;
92     public static final int UNDEFINED_UID = 7;
93
94     public static final int BSF_DEBUG_MANAGER_UID = 8;
95
96     ////////////////////////////////////////////////
97
public static final int FIRST_NON_RESERVED_UID = 9999;
98
99     ////////////////////////////////////////////////
100

101     public static final int NULL_OBJECT = 99;
102     public static final int VALUE_OBJECT = 100;
103     public static final int STUB_OBJECT = 101;
104     public static final int SKEL_OBJECT = 102;
105
106     ////////////////////////////////////////////////
107
// Reserved Uid for special object going across...
108
////////////////////////////////////////////////
109

110
111     ////////////////////////////////////////////////
112
// Type Id of object going across...
113
////////////////////////////////////////////////
114

115     public static final int BSF_DEBUG_MANAGER_TID = 104;
116     public static final int JS_ENGINE_TID = 105;
117     public static final int JS_CONTEXT_TID = 106;
118     public static final int JS_OBJECT_TID = 107;
119
120     public static final int BSF_DEBUGGER_TID = 108;
121     public static final int JS_CALLBACKS_TID = 109;
122
123     public static final int VALUE_OBJECT_TID = 110;
124
125     public static final int JS_CODE_TID = 111;
126
127     ////////////////////////////////////////////////
128
// Special type Id indicating a command has
129
// failed and that an execption object follows
130
// in the stream.
131
////////////////////////////////////////////////
132

133     public static final int ERROR_OCCURED = 150;
134     
135     
136     //-----------------------------------------------------------
137
// DebugManager Methods...
138
public static final int DM_GET_LANG_FROM_FILENAME = 300;
139     public static final int DM_IS_LANGUAGE_REGISTERED = 301;
140     public static final int DM_PLACE_BREAKPOINT_AT_LINE = 302;
141     public static final int DM_REMOVE_BREAKPOINT = 303;
142     public static final int DM_SET_ENTRY_EXIT = 304;
143     public static final int DM_REGISTER_DEBUGGER_FOR_LANG = 305;
144     public static final int DM_UNREGISTER_DEBUGGER_FOR_LANG = 306;
145     public static final int DM_QUIT_NOTIFY = 307;
146     
147     //-------------------------------------------------
148
// JsEngine Methods...
149
public static final int JE_GET_CONTEXT_AT = 401;
150     public static final int JE_GET_CONTEXT_COUNT = 402;
151
152     public static final int JE_RUN = 404;
153     public static final int JE_STEP_IN = 405;
154     public static final int JE_STEP_OUT = 406;
155     public static final int JE_STEP_OVER = 407;
156
157     public static final int JE_GET_GLOBAL_OBJECT = 409;
158     public static final int JE_GET_UNDEFINED_VALUE = 410;
159     
160     public static final int JE_SET_DEBUGGER = 411;
161     public static final int JE_GET_THREAD = 412;
162     public static final int JE_GET_THREADGROUP = 413;
163
164     //-------------------------------------------------
165
// JsObject Methods...
166
public static final int JO_DEFINE = 501;
167     public static final int JO_DELETE_BY_INDEX = 502;
168     public static final int JO_DELETE_BY_NAME = 503;
169     public static final int JO_GET_BY_NAME = 504;
170     public static final int JO_GET_BY_INDEX = 505;
171     public static final int JO_GET_CLASSNAME = 506;
172     public static final int JO_GET_DEFAULT_VALUE = 507;
173     public static final int JO_GET_IDS = 508;
174     public static final int JO_HAS_BY_INDEX = 509;
175     public static final int JO_HAS_BY_NAME = 510;
176     public static final int JO_GET_PROTOTYPE = 511;
177     public static final int JO_GET_SCOPE = 512;
178     public static final int JO_HAS_INSTANCE = 513;
179     public static final int JO_PUT_BY_INDEX = 514;
180     public static final int JO_PUT_BY_NAME = 515;
181     public static final int JO_SET_PROTOTYPE = 516;
182     public static final int JO_SET_SCOPE = 517;
183
184     public static final int JO_FUNCTION = 600;
185     public static final int JO_SCRIPT = 601;
186
187     //-------------------------------------------------
188
// JsCode Methods...
189
public static final int JC_GET_LINE_NUMBERS = 610;
190     
191     //-------------------------------------------------
192
// BSFDebugger Methods...
193
public static final int BSFD_CREATED_ENGINE = 701;
194     public static final int BSFD_DELETED_ENGINE = 702;
195     public static final int BSFD_DISCONNECT = 703;
196     
197     
198     //-------------------------------------------------
199
// JsContext Methods...
200
public static final int CX_BIND = 800;
201     public static final int CX_GET_CODE = 801;
202     public static final int CX_GET_DEPTH = 802;
203     public static final int CX_GET_ENGINE = 803;
204     public static final int CX_GET_LINE_NUMBER = 804;
205     public static final int CX_GET_SCOPE = 805;
206     public static final int CX_GET_SOURCE_NAME = 806;
207     public static final int CX_GET_THIS = 807;
208     
209     //-------------------------------------------------
210
// JsCallbacks Methods...
211

212     public static final int CB_POLL = 900;
213     public static final int CB_HANDLE_BREAKPOINT_HIT = 901;
214     public static final int CB_HANDLE_ENGINE_STOPPED = 902;
215     public static final int CB_HANDLE_EXCEPTION_THROWN = 903;
216     public static final int CB_HANDLE_STEPPING_DONE = 904;
217
218     ////////////////////////////////////////////////
219
////////////////////////////////////////////////
220
////////////////////////////////////////////////
221
static IntHashtable m_constantNames;
222         
223     public static String JavaDoc getConstantName(int id) {
224         String JavaDoc name = (String JavaDoc)m_constantNames.get(id);
225         if (name==null) name = "Unknown name for "+Integer.toString(id);
226         return name;
227     }
228
229     static {
230         m_constantNames = new IntHashtable();
231                         
232         m_constantNames.put(NULLTID,"NULLTID");
233         m_constantNames.put(NULLUID,"NULLUID");
234         m_constantNames.put(UNKNOWN_TID,"UNKNOWN_TID");
235         m_constantNames.put(UNKNOWN_UID,"UNKNOWN_UID");
236         m_constantNames.put(SPECIAL_TID,"SPECIAL_TID");
237         m_constantNames.put(NOT_FOUND_UID,"NOT_FOUND_UID");
238         m_constantNames.put(UNDEFINED_UID,"UNDEFINED_UID");
239         m_constantNames.put(NULL_OBJECT,"NULL_OBJECT");
240         m_constantNames.put(VALUE_OBJECT,"VALUE_OBJECT");
241         m_constantNames.put(STUB_OBJECT,"STUB_OBJECT");
242         m_constantNames.put(SKEL_OBJECT,"SKEL_OBJECT");
243         m_constantNames.put(BSF_DEBUG_MANAGER_UID,"BSF_DEBUG_MANAGER_UID");
244         m_constantNames.put(BSF_DEBUG_MANAGER_TID,"BSF_DEBUG_MANAGER_TID");
245         m_constantNames.put(JS_ENGINE_TID,"JS_ENGINE_TID");
246         m_constantNames.put(JS_CALLBACKS_TID,"JS_CALLBACKS_TID");
247         m_constantNames.put(JS_CONTEXT_TID,"JS_CONTEXT_TID");
248         m_constantNames.put(JS_OBJECT_TID,"JS_OBJECT_TID");
249         m_constantNames.put(JS_CODE_TID,"JS_CODE_TID");
250         m_constantNames.put(VALUE_OBJECT_TID,"VALUE_OBJECT_TID");
251         m_constantNames.put(BSF_DEBUGGER_TID,"BSF_DEBUGGER_TID");
252         m_constantNames.put(ERROR_OCCURED,"ERROR_OCCURED");
253         m_constantNames.put(DM_GET_LANG_FROM_FILENAME,"DM_GET_LANG_FROM_FILENAME");
254         m_constantNames.put(DM_IS_LANGUAGE_REGISTERED,"DM_IS_LANGUAGE_REGISTERED");
255         m_constantNames.put(DM_PLACE_BREAKPOINT_AT_LINE,"DM_PLACE_BREAKPOINT_AT_LINE");
256         m_constantNames.put(DM_REMOVE_BREAKPOINT,"DM_REMOVE_BREAKPOINT");
257         m_constantNames.put(DM_REGISTER_DEBUGGER_FOR_LANG,"DM_REGISTER_DEBUGGER_FOR_LANG");
258         m_constantNames.put(DM_UNREGISTER_DEBUGGER_FOR_LANG,"DM_UNREGISTER_DEBUGGER_FOR_LANG");
259         m_constantNames.put(DM_SET_ENTRY_EXIT,"DM_SET_ENTRY_EXIT");
260         m_constantNames.put(DM_QUIT_NOTIFY,"DM_QUIT_NOTIFY");
261         m_constantNames.put(JE_GET_CONTEXT_AT,"JE_GET_CONTEXT_AT");
262         m_constantNames.put(JE_GET_CONTEXT_COUNT,"JE_GET_CONTEXT_COUNT");
263         m_constantNames.put(JE_RUN,"JE_RUN");
264         m_constantNames.put(JE_STEP_IN,"JE_STEP_IN");
265         m_constantNames.put(JE_STEP_OUT,"JE_STEP_OUT");
266         m_constantNames.put(JE_STEP_OVER,"JE_STEP_OVER");
267         m_constantNames.put(JE_GET_GLOBAL_OBJECT,"JE_GET_GLOBAL_OBJECT");
268         m_constantNames.put(JE_GET_UNDEFINED_VALUE,"JE_GET_UNDEFINED_VALUE");
269         m_constantNames.put(JE_SET_DEBUGGER,"JE_SET_DEBUGGER");
270         m_constantNames.put(JE_GET_THREAD,"JE_GET_THREAD");
271         m_constantNames.put(JE_GET_THREADGROUP,"JE_GET_THREADGROUP");
272         m_constantNames.put(JO_DEFINE,"JO_DEFINE");
273         m_constantNames.put(JO_DELETE_BY_INDEX,"JO_DELETE_BY_INDEX");
274         m_constantNames.put(JO_DELETE_BY_NAME,"JO_DELETE_BY_NAME");
275         m_constantNames.put(JO_GET_BY_NAME,"JO_GET_BY_NAME");
276         m_constantNames.put(JO_GET_BY_INDEX,"JO_GET_BY_INDEX");
277         m_constantNames.put(JO_GET_CLASSNAME,"JO_GET_CLASSNAME");
278         m_constantNames.put(JO_GET_DEFAULT_VALUE,"JO_GET_DEFAULT_VALUE");
279         m_constantNames.put(JO_GET_IDS,"JO_GET_IDS");
280         m_constantNames.put(JO_HAS_BY_INDEX,"JO_HAS_BY_INDEX");
281         m_constantNames.put(JO_HAS_BY_NAME,"JO_HAS_BY_NAME");
282         m_constantNames.put(JO_GET_PROTOTYPE,"JO_GET_PROTOTYPE");
283         m_constantNames.put(JO_GET_SCOPE,"JO_GET_SCOPE");
284         m_constantNames.put(JO_HAS_INSTANCE,"JO_HAS_INSTANCE");
285         m_constantNames.put(JO_PUT_BY_INDEX,"JO_PUT_BY_INDEX");
286         m_constantNames.put(JO_PUT_BY_NAME,"JO_PUT_BY_NAME");
287         m_constantNames.put(JO_SET_PROTOTYPE,"JO_SET_PROTOTYPE");
288         m_constantNames.put(JO_SET_SCOPE,"JO_SET_SCOPE");
289         m_constantNames.put(JO_FUNCTION,"JO_FUNCTION");
290         m_constantNames.put(JO_SCRIPT,"JO_SCRIPT");
291         m_constantNames.put(JC_GET_LINE_NUMBERS,"JC_GET_LINE_NUMBERS");
292         m_constantNames.put(BSFD_CREATED_ENGINE,"BSFD_CREATED_ENGINE");
293         m_constantNames.put(BSFD_DELETED_ENGINE,"BSFD_DELETED_ENGINE");
294         m_constantNames.put(BSFD_DISCONNECT,"BSFD_DISCONNECT");
295         m_constantNames.put(CX_BIND,"CX_BIND");
296         m_constantNames.put(CX_GET_CODE,"CX_GET_CODE");
297         m_constantNames.put(CX_GET_DEPTH,"CX_GET_DEPTH");
298         m_constantNames.put(CX_GET_ENGINE,"CX_GET_ENGINE");
299         m_constantNames.put(CB_POLL,"CB_POLL");
300         m_constantNames.put(CX_GET_SCOPE,"CX_GET_SCOPE");
301         m_constantNames.put(CX_GET_LINE_NUMBER,"CX_GET_LINE_NUMBER");
302         m_constantNames.put(CX_GET_SOURCE_NAME,"CX_GET_SOURCE_NAME");
303         m_constantNames.put(CX_GET_THIS,"CX_GET_THIS");
304         m_constantNames.put(CB_POLL,"CB_POLL");
305         m_constantNames.put(CB_HANDLE_BREAKPOINT_HIT,"CB_HANDLE_BREAKPOINT_HIT");
306         m_constantNames.put(CB_HANDLE_ENGINE_STOPPED,"CB_HANDLE_ENGINE_STOPPED");
307         m_constantNames.put(CB_HANDLE_STEPPING_DONE,"CB_HANDLE_STEPPING_DONE");
308         m_constantNames.put(CB_HANDLE_EXCEPTION_THROWN,"CB_HANDLE_EXCEPTION_THROWN");
309
310     }
311
312 }
313
314
Popular Tags