Source Code Cross Referenced for JdwpReplyPacket.java in  » IDE-Eclipse » jdt » org » eclipse » jdi » internal » jdwp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdi.internal.jdwp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdi.internal.jdwp;
011:
012:        import java.io.IOException;
013:        import java.lang.reflect.Field;
014:        import java.lang.reflect.Modifier;
015:        import java.util.HashMap;
016:        import java.util.Map;
017:
018:        /**
019:         * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
020:         * declared by the JDWP specification.
021:         *
022:         */
023:        public class JdwpReplyPacket extends JdwpPacket {
024:            /** Error code constants. */
025:            public static final short NONE = 0;
026:            public static final short INVALID_THREAD = 10;
027:            public static final short INVALID_THREAD_GROUP = 11;
028:            public static final short INVALID_PRIORITY = 12;
029:            public static final short THREAD_NOT_SUSPENDED = 13;
030:            public static final short THREAD_SUSPENDED = 14;
031:            public static final short THREAD_NOT_ALIVE = 15;
032:            public static final short INVALID_OBJECT = 20;
033:            public static final short INVALID_CLASS = 21;
034:            public static final short CLASS_NOT_PREPARED = 22;
035:            public static final short INVALID_METHODID = 23;
036:            public static final short INVALID_LOCATION = 24;
037:            public static final short INVALID_FIELDID = 25;
038:            public static final short INVALID_FRAMEID = 30;
039:            public static final short NO_MORE_FRAMES = 31;
040:            public static final short OPAQUE_FRAME = 32;
041:            public static final short NOT_CURRENT_FRAME = 33;
042:            public static final short TYPE_MISMATCH = 34;
043:            public static final short INVALID_SLOT = 35;
044:            public static final short DUPLICATE = 40;
045:            public static final short NOT_FOUND = 41;
046:            public static final short INVALID_MONITOR = 50;
047:            public static final short NOT_MONITOR_OWNER = 51;
048:            public static final short INTERRUPT = 52;
049:            public static final short INVALID_CLASS_FORMAT = 60;
050:            public static final short CIRCULAR_CLASS_DEFINITION = 61;
051:            public static final short FAILS_VERIFICATION = 62;
052:            public static final short ADD_METHOD_NOT_IMPLEMENTED = 63;
053:            public static final short SCHEMA_CHANGE_NOT_IMPLEMENTED = 64;
054:            public static final short INVALID_TYPESTATE = 65;
055:            public static final short HIERARCHY_CHANGE_NOT_IMPLEMENTED = 66;
056:            public static final short DELETE_METHOD_NOT_IMPLEMENTED = 67;
057:            public static final short UNSUPPORTED_VERSION = 68;
058:            public static final short NAMES_DONT_MATCH = 69;
059:            public static final short CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 70;
060:            public static final short METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 71;
061:            public static final short NOT_IMPLEMENTED = 99;
062:            public static final short NULL_POINTER = 100;
063:            public static final short ABSENT_INFORMATION = 101;
064:            public static final short INVALID_EVENT_TYPE = 102;
065:            public static final short ILLEGAL_ARGUMENT = 103;
066:            public static final short OUT_OF_MEMORY = 110;
067:            public static final short ACCESS_DENIED = 111;
068:            public static final short VM_DEAD = 112;
069:            public static final short INTERNAL = 113;
070:            public static final short UNATTACHED_THREAD = 115;
071:            public static final short INVALID_TAG = 500;
072:            public static final short ALREADY_INVOKING = 502;
073:            public static final short INVALID_INDEX = 503;
074:            public static final short INVALID_LENGTH = 504;
075:            public static final short INVALID_STRING = 506;
076:            public static final short INVALID_CLASS_LOADER = 507;
077:            public static final short INVALID_ARRAY = 508;
078:            public static final short TRANSPORT_LOAD = 509;
079:            public static final short TRANSPORT_INIT = 510;
080:            public static final short NATIVE_METHOD = 511;
081:            public static final short INVALID_COUNT = 512;
082:            public static final short HCR_OPERATION_REFUSED = 900; // HCR specific.
083:
084:            /** Mapping of error codes to strings. */
085:            private static HashMap fErrorMap = null;
086:
087:            /** JDWP Error code. */
088:            private short fErrorCode;
089:
090:            /**
091:             * Creates new JdwpReplyPacket.
092:             */
093:            public JdwpReplyPacket() {
094:                setFlags(FLAG_REPLY_PACKET);
095:            }
096:
097:            /**
098:             * @return Returns JDWP Error code.
099:             */
100:            public short errorCode() {
101:                return fErrorCode;
102:            }
103:
104:            /**
105:             * Assigns JDWP Error code.
106:             */
107:            public void setErrorCode(short newValue) {
108:                fErrorCode = newValue;
109:            }
110:
111:            /**
112:             * Reads header fields that are specific for this type of packet.
113:             */
114:            protected int readSpecificHeaderFields(byte[] bytes, int index)
115:                    throws IOException {
116:                fErrorCode = (short) ((bytes[index] << 8) + (bytes[index + 1] << 0));
117:                return 2;
118:            }
119:
120:            /**
121:             * Writes header fields that are specific for this type of packet.
122:             */
123:            protected int writeSpecificHeaderFields(byte[] bytes, int index)
124:                    throws IOException {
125:                bytes[index] = (byte) ((fErrorCode >>> 8) & 0xFF);
126:                bytes[index + 1] = (byte) ((fErrorCode >>> 0) & 0xFF);
127:                return 2;
128:            }
129:
130:            /**
131:             * Retrieves constant mappings.
132:             */
133:            public static void getConstantMaps() {
134:                if (fErrorMap != null) {
135:                    return;
136:                }
137:
138:                Field[] fields = JdwpReplyPacket.class.getDeclaredFields();
139:                fErrorMap = new HashMap(fields.length);
140:                for (int i = 0; i < fields.length; i++) {
141:                    Field field = fields[i];
142:                    if ((field.getModifiers() & Modifier.PUBLIC) == 0
143:                            || (field.getModifiers() & Modifier.STATIC) == 0
144:                            || (field.getModifiers() & Modifier.FINAL) == 0)
145:                        continue;
146:
147:                    try {
148:                        Integer intValue = new Integer(field.getInt(null));
149:                        fErrorMap.put(intValue, field.getName());
150:                    } catch (IllegalAccessException e) {
151:                        // Will not occur for own class.
152:                    } catch (IllegalArgumentException e) {
153:                        // Should not occur.
154:                        // We should take care that all public static final constants
155:                        // in this class are numbers that are convertible to int.
156:                    }
157:                }
158:            }
159:
160:            /**
161:             * @return Returns a map with string representations of error codes.
162:             */
163:            public static Map errorMap() {
164:                getConstantMaps();
165:                return fErrorMap;
166:            }
167:
168:            /* (non-Javadoc)
169:             * @see java.lang.Object#toString()
170:             */
171:            public String toString() {
172:                StringBuffer buffer = new StringBuffer();
173:                buffer.append("["); //$NON-NLS-1$
174:                buffer.append(getId());
175:                buffer.append("] "); //$NON-NLS-1$
176:                buffer.append("(reply)"); //$NON-NLS-1$
177:                short ec = errorCode();
178:                if (ec != NONE) {
179:                    buffer.append(" ERROR CODE: "); //$NON-NLS-1$
180:                    buffer.append(ec);
181:                }
182:                return buffer.toString();
183:            }
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.