Source Code Cross Referenced for EventImpl.java in  » IDE-Eclipse » jdt » org » eclipse » jdi » internal » event » 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.event 
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.event;
011:
012:        import java.io.DataInputStream;
013:        import java.io.IOException;
014:        import java.util.HashMap;
015:        import java.util.Map;
016:
017:        import org.eclipse.jdi.internal.MirrorImpl;
018:        import org.eclipse.jdi.internal.ThreadReferenceImpl;
019:        import org.eclipse.jdi.internal.VirtualMachineImpl;
020:        import org.eclipse.jdi.internal.request.RequestID;
021:
022:        import com.sun.jdi.ThreadReference;
023:        import com.sun.jdi.event.Event;
024:        import com.sun.jdi.request.EventRequest;
025:
026:        /**
027:         * This class implements the corresponding interfaces
028:         * declared by the JDI specification. See the com.sun.jdi package
029:         * for more information.
030:         *
031:         */
032:        public abstract class EventImpl extends MirrorImpl implements  Event {
033:            /** Constants for EventKind. */
034:            public static final byte EVENT_SINGLE_STEP = 1;
035:            public static final byte EVENT_BREAKPOINT = 2;
036:            public static final byte EVENT_FRAME_POP = 3;
037:            public static final byte EVENT_EXCEPTION = 4;
038:            public static final byte EVENT_USER_DEFINED = 5;
039:            public static final byte EVENT_THREAD_START = 6;
040:            public static final byte EVENT_THREAD_END = 7;
041:            public static final byte EVENT_CLASS_PREPARE = 8;
042:            public static final byte EVENT_CLASS_UNLOAD = 9;
043:            public static final byte EVENT_CLASS_LOAD = 10;
044:            public static final byte EVENT_FIELD_ACCESS = 20;
045:            public static final byte EVENT_FIELD_MODIFICATION = 21;
046:            public static final byte EVENT_EXCEPTION_CATCH = 30;
047:            public static final byte EVENT_METHOD_ENTRY = 40;
048:            public static final byte EVENT_METHOD_EXIT = 41;
049:            public static final byte EVENT_METHOD_EXIT_WITH_RETURN_VALUE = 42;
050:            public static final byte EVENT_MONITOR_CONTENDED_ENTER = 43;
051:            public static final byte EVENT_MONITOR_CONTENDED_ENTERED = 44;
052:            public static final byte EVENT_MONITOR_WAIT = 45;
053:            public static final byte EVENT_MONITOR_WAITED = 46;
054:            public static final byte EVENT_VM_INIT = 90;
055:            public static final byte EVENT_VM_DEATH = 99;
056:            public static final byte EVENT_VM_DISCONNECTED = 100; // Never sent by across JDWP.
057:            public static final byte EVENT_VM_START = EVENT_VM_INIT;
058:            public static final byte EVENT_THREAD_DEATH = EVENT_THREAD_END;
059:
060:            /** ThreadReference of thread that generated this event. */
061:            protected ThreadReferenceImpl fThreadRef;
062:
063:            /** Mapping of command codes to strings. */
064:            private static HashMap fEventKindMap = null;
065:
066:            /** Request ID of event. */
067:            private RequestID fRequestID;
068:
069:            /** The EventRequest that requested this event. */
070:            private EventRequest fRequest;
071:
072:            /**
073:             * Creates new EventImpl, only used by subclasses.
074:             */
075:            protected EventImpl(String description, VirtualMachineImpl vmImpl,
076:                    RequestID requestID) {
077:                super (description, vmImpl);
078:                fRequestID = requestID;
079:            }
080:
081:            /**
082:             * @return Returns ThreadReference of thread that generated this event.
083:             */
084:            public ThreadReference thread() {
085:                return fThreadRef;
086:            }
087:
088:            /**
089:             * @return Returns requestID.
090:             */
091:            public RequestID requestID() {
092:                return fRequestID;
093:            }
094:
095:            /**
096:             * @return Returns string representation.
097:             */
098:            public String toString() {
099:                return super .toString() + ": " + fRequestID; //$NON-NLS-1$
100:            }
101:
102:            /**
103:             * @return Creates, reads and returns new EventImpl.
104:             */
105:            public static EventImpl read(MirrorImpl target,
106:                    DataInputStream dataInStream) throws IOException {
107:                byte eventKind = target.readByte(
108:                        "event kind", eventKindMap(), dataInStream); //$NON-NLS-1$
109:                RequestID requestID = RequestID.read(target, dataInStream);
110:
111:                // Create, read and return Event of eventKind.
112:                EventImpl result;
113:                switch (eventKind) {
114:                case 0:
115:                    return null;
116:                case AccessWatchpointEventImpl.EVENT_KIND:
117:                    result = AccessWatchpointEventImpl.read(target, requestID,
118:                            dataInStream);
119:                    break;
120:                case BreakpointEventImpl.EVENT_KIND:
121:                    result = BreakpointEventImpl.read(target, requestID,
122:                            dataInStream);
123:                    break;
124:                case ClassPrepareEventImpl.EVENT_KIND:
125:                    result = ClassPrepareEventImpl.read(target, requestID,
126:                            dataInStream);
127:                    break;
128:                case ClassUnloadEventImpl.EVENT_KIND:
129:                    result = ClassUnloadEventImpl.read(target, requestID,
130:                            dataInStream);
131:                    break;
132:                case ExceptionEventImpl.EVENT_KIND:
133:                    result = ExceptionEventImpl.read(target, requestID,
134:                            dataInStream);
135:                    break;
136:                case MethodEntryEventImpl.EVENT_KIND:
137:                    result = MethodEntryEventImpl.read(target, requestID,
138:                            dataInStream);
139:                    break;
140:                case MethodExitEventImpl.EVENT_KIND:
141:                    result = MethodExitEventImpl.read(target, requestID,
142:                            dataInStream);
143:                    break;
144:                case EVENT_METHOD_EXIT_WITH_RETURN_VALUE:
145:                    result = MethodExitEventImpl.readWithReturnValue(target,
146:                            requestID, dataInStream);
147:                    break;
148:                case MonitorContendedEnteredEventImpl.EVENT_KIND:
149:                    result = MonitorContendedEnteredEventImpl.read(target,
150:                            requestID, dataInStream);
151:                    break;
152:                case MonitorContendedEnterEventImpl.EVENT_KIND:
153:                    result = MonitorContendedEnterEventImpl.read(target,
154:                            requestID, dataInStream);
155:                    break;
156:                case MonitorWaitedEventImpl.EVENT_KIND:
157:                    result = MonitorWaitedEventImpl.read(target, requestID,
158:                            dataInStream);
159:                    break;
160:                case MonitorWaitEventImpl.EVENT_KIND:
161:                    result = MonitorWaitEventImpl.read(target, requestID,
162:                            dataInStream);
163:                    break;
164:                case ModificationWatchpointEventImpl.EVENT_KIND:
165:                    result = ModificationWatchpointEventImpl.read(target,
166:                            requestID, dataInStream);
167:                    break;
168:                case StepEventImpl.EVENT_KIND:
169:                    result = StepEventImpl
170:                            .read(target, requestID, dataInStream);
171:                    break;
172:                case ThreadDeathEventImpl.EVENT_KIND:
173:                    result = ThreadDeathEventImpl.read(target, requestID,
174:                            dataInStream);
175:                    break;
176:                case ThreadStartEventImpl.EVENT_KIND:
177:                    result = ThreadStartEventImpl.read(target, requestID,
178:                            dataInStream);
179:                    break;
180:                case VMDeathEventImpl.EVENT_KIND:
181:                    result = VMDeathEventImpl.read(target, requestID,
182:                            dataInStream);
183:                    break;
184:                case VMDisconnectEventImpl.EVENT_KIND:
185:                    result = VMDisconnectEventImpl.read(target, requestID,
186:                            dataInStream);
187:                    break;
188:                case VMStartEventImpl.EVENT_KIND:
189:                    result = VMStartEventImpl.read(target, requestID,
190:                            dataInStream);
191:                    break;
192:                default:
193:                    throw new IOException(
194:                            EventMessages.EventImpl_Read_invalid_EventKind___1
195:                                    + eventKind);
196:                }
197:
198:                // Find and store original request.
199:                if (!requestID.isNull())
200:                    result.fRequest = target.virtualMachineImpl()
201:                            .eventRequestManagerImpl().findRequest(result);
202:
203:                return result;
204:            }
205:
206:            /**
207:             * @return Returns EventRequest that caused this event to be generated by the Virtual Machine.
208:             */
209:            public EventRequest request() {
210:                return fRequest;
211:            }
212:
213:            /**
214:             * Retrieves constant mappings.
215:             */
216:            public static void getConstantMaps() {
217:                if (fEventKindMap != null)
218:                    return;
219:
220:                java.lang.reflect.Field[] fields = EventImpl.class
221:                        .getDeclaredFields();
222:                fEventKindMap = new HashMap();
223:                for (int i = 0; i < fields.length; i++) {
224:                    java.lang.reflect.Field field = fields[i];
225:                    if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0
226:                            || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0
227:                            || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
228:                        continue;
229:
230:                    try {
231:                        String name = field.getName();
232:                        Integer intValue = new Integer(field.getInt(null));
233:
234:                        if (name.startsWith("EVENT_")) { //$NON-NLS-1$
235:                            name = name.substring(6);
236:                            fEventKindMap.put(intValue, name);
237:                        }
238:                    } catch (IllegalAccessException e) {
239:                        // Will not occur for own class.
240:                    } catch (IllegalArgumentException e) {
241:                        // Should not occur.
242:                        // We should take care that all public static final constants
243:                        // in this class are numbers that are convertible to int.
244:                    }
245:                }
246:            }
247:
248:            /**
249:             * @return Returns a map with string representations of tags.
250:             */
251:            public static Map eventKindMap() {
252:                getConstantMaps();
253:                return fEventKindMap;
254:            }
255:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.