Source Code Cross Referenced for TestVMListener.java in  » Code-Analyzer » javapathfinder » gov » nasa » jpf » embedded » 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 » Code Analyzer » javapathfinder » gov.nasa.jpf.embedded 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //
002:        // Copyright (C) 2005 United States Government as represented by the
003:        // Administrator of the National Aeronautics and Space Administration
004:        // (NASA).  All Rights Reserved.
005:        // 
006:        // This software is distributed under the NASA Open Source Agreement
007:        // (NOSA), version 1.3.  The NOSA has been approved by the Open Source
008:        // Initiative.  See the file NOSA-1.3-JPF at the top of the distribution
009:        // directory tree for the complete NOSA document.
010:        // 
011:        // THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
012:        // KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
013:        // LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
014:        // SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
015:        // A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
016:        // THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
017:        // DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
018:        //
019:
020:        package gov.nasa.jpf.embedded;
021:
022:        import gov.nasa.jpf.Config;
023:        import gov.nasa.jpf.VMListener;
024:        import gov.nasa.jpf.VM;
025:        import gov.nasa.jpf.JPF;
026:        import gov.nasa.jpf.jvm.JVM;
027:        import gov.nasa.jpf.jvm.ThreadInfo;
028:        import gov.nasa.jpf.jvm.ElementInfo;
029:
030:        /**
031:         * TestVMListener - unit test of the VMListener interface
032:         */
033:        public class TestVMListener implements  VMListener {
034:
035:            /**
036:             * VM has executed next instruction
037:             * (can be used to analyze branches, monitor PUTFIELD / GETFIELD and
038:             * INVOKExx / RETURN instructions)
039:             */
040:            public void instructionExecuted(VM vm) {
041:                //JVM jvm = (JVM) vm;
042:                //ThreadInfo ti = jvm.getLastThreadInfo();
043:                //Instruction insn = jvm.getLastInstruction();
044:                //System.out.println("Instruction executed: " + ti.getIndex() + " : " + insn);
045:            }
046:
047:            /**
048:             * new class was loaded
049:             */
050:            public void classLoaded(VM vm) {
051:                // TODO
052:            }
053:
054:            /**
055:             * exception was thrown
056:             */
057:            public void exceptionThrown(VM vm) {
058:                // TODO
059:            }
060:
061:            /**
062:             * new object was created
063:             */
064:            public void objectCreated(VM vm) {
065:                JVM jvm = (JVM) vm;
066:                ThreadInfo ti = jvm.getLastThreadInfo();
067:                ElementInfo ei = jvm.getLastElementInfo();
068:                System.out.println("objectCreated: " + ti.getIndex() + ", "
069:                        + ei.getClassInfo().getName() + " = " + ei.getIndex());
070:            }
071:
072:            /**
073:             * object was garbage collected (after potential finalization)
074:             */
075:            public void objectReleased(VM vm) {
076:                JVM jvm = (JVM) vm;
077:                ElementInfo ei = jvm.getLastElementInfo();
078:                System.out.println("objectReleased: "
079:                        + ei.getClassInfo().getName() + " = " + ei.getIndex());
080:            }
081:
082:            public void gcBegin(VM vm) {
083:                JVM jvm = (JVM) vm;
084:                System.out.println("gcBegin");
085:            }
086:
087:            public void gcEnd(VM vm) {
088:                JVM jvm = (JVM) vm;
089:                System.out.println("gcEnd");
090:            }
091:
092:            /**
093:             * new Thread entered run() method
094:             */
095:            public void threadStarted(VM vm) {
096:                JVM jvm = (JVM) vm;
097:                ThreadInfo ti = jvm.getLastThreadInfo();
098:                System.out.println("threadStarted: " + ti.getIndex());
099:            }
100:
101:            /**
102:             * Thread exited run() method
103:             */
104:            public void threadTerminated(VM vm) {
105:                JVM jvm = (JVM) vm;
106:                ThreadInfo ti = jvm.getLastThreadInfo();
107:                System.out.println("threadTerminated: " + ti.getIndex());
108:            }
109:
110:            void filterArgs(String[] args) {
111:                // we don't have any
112:            }
113:
114:            public static void main(String[] args) {
115:                TestVMListener listener = new TestVMListener();
116:                listener.filterArgs(args);
117:
118:                Config conf = JPF.createConfig(args);
119:                // here we can set our own params
120:                JPF jpf = new JPF(conf);
121:                jpf.getVM().addListener(listener);
122:
123:                System.out.println("---------------- starting JPF on class: "
124:                        + args[0]);
125:                jpf.run();
126:                System.out.println("---------------- JPF terminated");
127:            }
128:
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.