Source Code Cross Referenced for IsCollectedDebuggee.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » jpda » tests » jdwp » ObjectReference » 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 » Apache Harmony Java SE » org package » org.apache.harmony.jpda.tests.jdwp.ObjectReference 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *
015:         *  See the License for the specific language governing permissions and
016:         *  limitations under the License.
017:         */
018:
019:        /**
020:         * @author Anatoly F. Bondarenko
021:         * @version $Revision: 1.3 $
022:         */
023:
024:        /**
025:         * Created on 04.03.2005
026:         */package org.apache.harmony.jpda.tests.jdwp.ObjectReference;
027:
028:        import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
029:        import org.apache.harmony.jpda.tests.share.SyncDebuggee;
030:
031:        public class IsCollectedDebuggee extends SyncDebuggee {
032:
033:            static IsCollectedObject001_01 checkedObject_01;
034:            static boolean checkedObject_01_Finalized = false;
035:            static IsCollectedObject001_02 checkedObject_02;
036:            static boolean checkedObject_02_Finalized = false;
037:            static IsCollectedObject001_03 checkedObject_03;
038:            static boolean checkedObject_03_Finalized = false;
039:
040:            public void run() {
041:                logWriter.println("--> Debuggee: IsCollectedDebuggee: START");
042:
043:                checkedObject_01 = new IsCollectedObject001_01();
044:                checkedObject_02 = new IsCollectedObject001_02();
045:                checkedObject_03 = new IsCollectedObject001_03();
046:
047:                synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
048:                String messageFromTest = synchronizer.receiveMessage();
049:                if (messageFromTest.equals("TO_FINISH")) {
050:                    logWriter
051:                            .println("--> Debuggee: IsCollectedDebuggee: FINISH");
052:                    return;
053:                }
054:
055:                checkedObject_01 = null;
056:                checkedObject_02 = null;
057:                checkedObject_03 = null;
058:                long[][] longArray;
059:                int i = 0;
060:                try {
061:                    longArray = new long[1000000][];
062:                    int arraysNumberLimit = 7; // max - longArray.length
063:                    logWriter
064:                            .println("--> Debuggee: memory depletion - creating 'long[1000000]' arrays ("
065:                                    + arraysNumberLimit + ")...");
066:                    for (; i < arraysNumberLimit; i++) {
067:                        longArray[i] = new long[1000000];
068:                    }
069:                } catch (OutOfMemoryError outOfMem) {
070:                    logWriter.println("--> Debuggee: OutOfMemoryError!!!");
071:                    // logWriter.println("--> Debuggee: i = " + i);
072:                }
073:                longArray = null;
074:                System.gc();
075:                logWriter.println("--> Debuggee: AFTER System.gc():");
076:                logWriter.println("--> Debuggee: checkedObject_01 = "
077:                        + checkedObject_01);
078:                logWriter.println("--> Debuggee: checkedObject_01_UNLOADed = "
079:                        + checkedObject_01_Finalized);
080:                logWriter.println("--> Debuggee: checkedObject_02 = "
081:                        + checkedObject_02);
082:                logWriter.println("--> Debuggee: checkedObject_02_UNLOADed = "
083:                        + checkedObject_02_Finalized);
084:                logWriter.println("--> Debuggee: checkedObject_03 = "
085:                        + checkedObject_03);
086:                logWriter.println("--> Debuggee: checkedObject_03_UNLOADed = "
087:                        + checkedObject_03_Finalized);
088:
089:                String messageForTest = null;
090:                if (checkedObject_01_Finalized) {
091:                    if (checkedObject_02_Finalized) {
092:                        messageForTest = "checkedObject_01 is UNLOADed; checkedObject_02 is UNLOADed;";
093:                    } else {
094:                        messageForTest = "checkedObject_01 is UNLOADed; checkedObject_02 is NOT UNLOADed;";
095:                    }
096:                } else {
097:                    if (checkedObject_02_Finalized) {
098:                        messageForTest = "checkedObject_01 is NOT UNLOADed; checkedObject_02 is UNLOADed;";
099:                    } else {
100:                        messageForTest = "checkedObject_01 is NOT UNLOADed; checkedObject_02 is NOT UNLOADed;";
101:                    }
102:                }
103:                logWriter.println("--> Debuggee: Send to test message: \""
104:                        + messageForTest + "\"");
105:                synchronizer.sendMessage(messageForTest);
106:                synchronizer
107:                        .receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
108:
109:                logWriter.println("--> Debuggee: IsCollectedDebuggee: FINISH");
110:
111:            }
112:
113:            public static void main(String[] args) {
114:                runDebuggee(IsCollectedDebuggee.class);
115:            }
116:
117:        }
118:
119:        class IsCollectedObject001_01 {
120:            protected void finalize() throws Throwable {
121:                IsCollectedDebuggee.checkedObject_01_Finalized = true;
122:                super .finalize();
123:            }
124:        }
125:
126:        class IsCollectedObject001_02 {
127:            protected void finalize() throws Throwable {
128:                IsCollectedDebuggee.checkedObject_02_Finalized = true;
129:                super .finalize();
130:            }
131:        }
132:
133:        class IsCollectedObject001_03 {
134:            protected void finalize() throws Throwable {
135:                IsCollectedDebuggee.checkedObject_03_Finalized = true;
136:                super.finalize();
137:            }
138:        }
w___ww___.___j_a__v_a___2__s_.__c___om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.