Source Code Cross Referenced for Debug.java in  » Database-DBMS » db4o-6.4 » com » db4o » 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 » Database DBMS » db4o 6.4 » com.db4o 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (C) 2004 - 2007  db4objects Inc.  http://www.db4o.com
002:
003:        This file is part of the db4o open source object database.
004:
005:        db4o is free software; you can redistribute it and/or modify it under
006:        the terms of version 2 of the GNU General Public License as published
007:        by the Free Software Foundation and as clarified by db4objects' GPL 
008:        interpretation policy, available at
009:        http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
010:        Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
011:        Suite 350, San Mateo, CA 94403, USA.
012:
013:        db4o is distributed in the hope that it will be useful, but WITHOUT ANY
014:        WARRANTY; without even the implied warranty of MERCHANTABILITY or
015:        FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
016:        for more details.
017:
018:        You should have received a copy of the GNU General Public License along
019:        with this program; if not, write to the Free Software Foundation, Inc.,
020:        59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */
021:        package com.db4o;
022:
023:        import com.db4o.foundation.*;
024:        import com.db4o.internal.*;
025:        import com.db4o.internal.marshall.*;
026:        import com.db4o.marshall.*;
027:
028:        /**
029:         * @exclude
030:         */
031:        public abstract class Debug extends Debug4 {
032:
033:            /**
034:             * indexes all fields
035:             */
036:            public static final boolean indexAllFields = false;
037:
038:            /**
039:             * prints query graph information to the console
040:             */
041:            public static final boolean queries = false;
042:
043:            /**
044:             * prints more stack traces
045:             */
046:            public static final boolean atHome = false;
047:
048:            /**
049:             * makes C/S timeouts longer, so C/S does not time out in the debugger
050:             */
051:            public static final boolean longTimeOuts = false;
052:
053:            /**
054:             * turns freespace debuggin on 
055:             */
056:            public static final boolean freespace = Deploy.debug;
057:
058:            /**
059:             * fills deleted slots with 'X' and overrides any configured
060:             * freespace filler
061:             */
062:            public static final boolean xbytes = freespace;
063:
064:            /**
065:             * checks monitor conditions to make sure only the thread
066:             * with the global monitor is allowed entry to the core
067:             */
068:            public static final boolean checkSychronization = false;
069:
070:            /**
071:             * makes sure a configuration entry is generated for each persistent
072:             * class 
073:             */
074:            public static final boolean configureAllClasses = indexAllFields;
075:
076:            /**
077:             * makes sure a configuration entry is generated for each persistent
078:             * field
079:             */
080:            public static final boolean configureAllFields = indexAllFields;
081:
082:            /**
083:             * allows turning weak references off
084:             */
085:            public static final boolean weakReferences = true;
086:
087:            /**
088:             * prints all communicated messages to the console
089:             */
090:            public static final boolean messages = false;
091:
092:            /**
093:             * allows turning NIO off on Java
094:             */
095:            public static final boolean nio = true;
096:
097:            /**
098:             * allows overriding the file locking mechanism to turn it off
099:             */
100:            public static final boolean lockFile = true;
101:
102:            /**
103:             * allows faking the Db4oDatabase identity object, so the first
104:             * stored object in the debugger is the actually persisted object  
105:             */
106:            public static final boolean staticIdentity = false;
107:
108:            /**
109:             * turn to false, to prevent reading old PBootRecord object
110:             * for debugging updating database files.
111:             */
112:            public static final boolean readBootRecord = true;
113:
114:            public static void expect(boolean cond) {
115:                if (!cond) {
116:                    throw new RuntimeException("Should never happen");
117:                }
118:            }
119:
120:            public static void ensureLock(Object obj) {
121:                if (atHome) {
122:                    try {
123:                        obj.wait(1);
124:                    } catch (IllegalMonitorStateException imse) {
125:                        System.err.println("No Lock Alarm.");
126:                        imse.printStackTrace();
127:                    } catch (Exception e) {
128:                        e.printStackTrace();
129:                    }
130:                }
131:            }
132:
133:            public static boolean exceedsMaximumBlockSize(int a_length) {
134:                if (a_length > Const4.MAXIMUM_BLOCK_SIZE) {
135:                    if (atHome) {
136:                        System.err.println("Maximum block size  exceeded!!!");
137:                        new Exception().printStackTrace();
138:                    }
139:                    return true;
140:                }
141:                return false;
142:            }
143:
144:            public static boolean exceedsMaximumArrayEntries(int a_entries,
145:                    boolean a_primitive) {
146:                if (a_entries > (a_primitive ? Const4.MAXIMUM_ARRAY_ENTRIES_PRIMITIVE
147:                        : Const4.MAXIMUM_ARRAY_ENTRIES)) {
148:                    if (atHome) {
149:                        System.err
150:                                .println("Maximum array elements exceeded!!!");
151:                        new Exception().printStackTrace();
152:                    }
153:                    return true;
154:                }
155:                return false;
156:            }
157:
158:            public static final void readBegin(ReadBuffer buffer,
159:                    byte identifier) {
160:                if (Deploy.debug) {
161:                    if (Deploy.brackets) {
162:                        if (buffer.readByte() != Const4.YAPBEGIN) {
163:                            throw new RuntimeException(
164:                                    "Debug.readBegin() YAPBEGIN expected.");
165:                        }
166:                    }
167:                    if (Deploy.identifiers) {
168:                        byte readB = buffer.readByte();
169:                        if (readB != identifier) {
170:                            throw new RuntimeException(
171:                                    "Debug.readBegin() wrong identifier: "
172:                                            + (char) readB);
173:                        }
174:                    }
175:                }
176:
177:            }
178:
179:            public static final void readEnd(ReadBuffer buffer) {
180:                if (Deploy.debug && Deploy.brackets) {
181:                    if (buffer.readByte() != Const4.YAPEND) {
182:                        throw new RuntimeException(
183:                                "Debug.readEnd() YAPEND expected");
184:                    }
185:                }
186:            }
187:
188:            public static final void writeBegin(WriteBuffer buffer,
189:                    byte identifier) {
190:                if (Deploy.debug) {
191:                    if (buffer instanceof  MarshallingContext) {
192:                        Buffer prepend = new Buffer(2);
193:                        if (Deploy.brackets) {
194:                            prepend.writeByte(Const4.YAPBEGIN);
195:                        }
196:                        if (Deploy.identifiers) {
197:                            prepend.writeByte(identifier);
198:                        }
199:                        ((MarshallingContext) buffer)
200:                                .debugPrependNextWrite(prepend);
201:                        return;
202:                    }
203:                    if (Deploy.brackets) {
204:                        buffer.writeByte(Const4.YAPBEGIN);
205:                    }
206:                    if (Deploy.identifiers) {
207:                        buffer.writeByte(identifier);
208:                    }
209:                }
210:            }
211:
212:            public static final void writeEnd(WriteBuffer buffer) {
213:                if (Deploy.debug && Deploy.brackets) {
214:                    if (buffer instanceof  MarshallingContext) {
215:                        ((MarshallingContext) buffer)
216:                                .debugWriteEnd(Const4.YAPEND);
217:                        return;
218:                    }
219:                    buffer.writeByte(Const4.YAPEND);
220:                }
221:            }
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.