Source Code Cross Referenced for Reply.java in  » 6.0-JDK-Modules » j2me » com » sun » cldchi » tools » memoryprofiler » 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 » 6.0 JDK Modules » j2me » com.sun.cldchi.tools.memoryprofiler.jdwp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.cldchi.tools.memoryprofiler.jdwp;
028:
029:        import java.util.Vector;
030:
031:        /**
032:         * This class represents a JDWP reply packet. This class is widely
033:         * used in all parts of KJDB. A typical use of tyhis class is as follows:
034:         * <ul>
035:         * <li> Prepare JDWP command (see <code>jdwp.Command</code>) for details
036:         * <li> Execute the command using <code>BackEndTest.checkReplyF()</code>
037:         * method and receive the JDWP reply packet
038:         * <li> Use <code>resetDataParser()</code> method before starting reading
039:         * packet's data
040:         * <li> Read the packet's data using <code>get</code> <code>ByteBuffer</code>
041:         * and <code>Packet</code> methods
042:         * </ul> 
043:         * 
044:         * @see jdwp.Command
045:         * @see jdwp.BackEndTest#checkReplyF(jdwp.Command)
046:         * @see jdwp.Packet
047:         * @see jdwp.Packet#resetDataParser()
048:         * @see jdwp.ByteBuffer
049:         */
050:
051:        class Reply extends Packet implements  VMReply {
052:
053:            /**
054:             * Error code constant that indicates that no error occured.
055:             */
056:            public final static int errOk = 0x0;
057:
058:            /** 
059:             * Error code constant that indicates that the packet has wrong size.
060:             */
061:            public final static int errWrongPacketSize = 0x400;
062:
063:            /** 
064:             * Error code constant that indicates that JDWP reply packet is not
065:             * received as expected.
066:             */
067:            public final static int errNotAvailable = 0x401;
068:
069:            /** 
070:             * JDWP Event/Composite command number.
071:             */
072:            public final static int errEvent = 0x4064;
073:
074:            /**
075:             * Returns value of the "error code" field of JDWP reply packet.
076:             *
077:             * @return a error code of JDWP reply
078:             */
079:            public int getErrorCode() {
080:                int err = 0;
081:                try {
082:                    err = (int) getID(ErrorCodeOffset, 2);
083:                } catch (BoundException e) {
084:                }
085:                ;
086:                return err;
087:            }
088:
089:            /**
090:             * Sets value of the "error code" field of JDWP reply packet.
091:             *
092:             * @param err a error code of JDWP reply that should be set
093:             */
094:
095:            public void setErrorCode(long err) {
096:                try {
097:                    putID(ErrorCodeOffset, err, 2);
098:                } catch (BoundException e) {
099:                }
100:                ;
101:            }
102:
103:            /**
104:             * This method
105:             * prepares a JDWP reply packet with specified error code.
106:             *
107:             * @param ErrorCode a error code of the JDWP reply
108:             * @return a JDWP reply with the specified error code
109:             */
110:
111:            static Reply Error(int ErrorCode) {
112:
113:                Reply r = new Reply();
114:                r.setLength();
115:                r.setID(0);
116:                r.setFlags(flReply);
117:                r.setErrorCode(ErrorCode);
118:                return r;
119:            }
120:
121:            /**
122:             * Returns true if this packet's error code equals zero.
123:             *
124:             * @return <code>true</code> if the JDWP reply has error code
125:             * <code>NONE</code> and <code>false</code> otherwise
126:             */
127:            public boolean ok() {
128:                return (getErrorCode() == errOk);
129:            }
130:
131:            /**
132:             * Returns a string representation of the reply packet. This method
133:             * is used by <code>BackEndTest</code> to print all the
134:             * replies that were not requested by other parts of code. It's useful
135:             * for localizing problems.
136:             *
137:             * @return a string representation of the reply packet
138:             *
139:             * @see jdwp.BackEndTest#printReplies()
140:             */
141:            public String toString() {
142:                String s;
143:                if (getFlags() == 0)
144:                    s = "command    ";
145:                else
146:                    s = "error code ";
147:                return "length     " + Tools.Hex(length(), 8) + "\n"
148:                        + "id         " + Tools.Hex(getID(), 8) + "\n"
149:                        + "flags      " + Tools.Hex(getFlags(), 2) + "\n" + s
150:                        + Tools.Hex(getErrorCode(), 4) + "\n"
151:                        + super.toString(PacketHeaderSize);
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.