Source Code Cross Referenced for OzoneODMG.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » odmg » 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 » Ozone 1.1 » org.ozoneDB.odmg 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // You can redistribute this software and/or modify it under the terms of
002:        // the Ozone Library License version 1 published by ozone-db.org.
003:        //
004:        // The original code and portions created by SMB are
005:        // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
006:        //
007:        // $Id: OzoneODMG.java,v 1.1 2002/05/08 15:03:21 per_nyfelt Exp $
008:
009:        package org.ozoneDB.odmg;
010:
011:        import java.io.*;
012:        import org.odmg.*;
013:        import org.ozoneDB.DxLib.*;
014:
015:        /**
016:         * Implementation of the ODMG {@link Implementation} interface.
017:         * 
018:         * 
019:         * @author <a href="http://www.softwarebuero.de/">SMB</a>
020:         * @version $Revision: 1.1 $Date: 2002/05/08 15:03:21 $
021:         */
022:        public class OzoneODMG extends ODMG {
023:
024:            /**
025:             * All {@link OzoneDatabase} objects that are created by this factory and
026:             * that currently are open.
027:             */
028:            private transient DxSet dbs;
029:
030:            public OzoneODMG() {
031:                if (org.ozoneDB.core.Env.currentEnv() != null) {
032:                    throw new ODMGRuntimeException(
033:                            "Method must not be called from inside an ozone database object.");
034:                }
035:                dbs = new DxHashSet();
036:            }
037:
038:            /**
039:             * Create a new <code>Database</code> object.
040:             * @return The new <code>Database</code> object.
041:             * @see org.odmg.Database
042:             */
043:            public synchronized Database newDatabase() {
044:                if (org.ozoneDB.core.Env.currentEnv() != null) {
045:                    throw new ODMGRuntimeException(
046:                            "Method must not be called from inside an ozone database object.");
047:                }
048:                Database db = new OzoneODMGDatabase(this );
049:                return db;
050:            }
051:
052:            /**
053:             * This method is called by the database objects to inform their factory
054:             * that another database actually has been opened.
055:             */
056:            protected synchronized void databaseOpened(Database db) {
057:                // don't allow more than one database per factory; the code to support
058:                // this is there but this feature avoid determine the database of a
059:                // given thread which is important for the enhanced ozone version of
060:                // the ODMG Implementation interface
061:                if (dbs.count() > 0) {
062:                    throw new ODMGRuntimeException(
063:                            "More than one open databases per factory are not allowed.");
064:                }
065:
066:                dbs.add(db);
067:            }
068:
069:            protected synchronized void databaseClosed(Database db) {
070:                dbs.remove(db);
071:            }
072:
073:            /**
074:             * Get the <code>Database</code> that contains the object <code>obj</code>.
075:             * @param obj The object.
076:             * @return The <code>Database</code> that contains the object.
077:             */
078:            public Database getDatabase(Object obj) {
079:                if (org.ozoneDB.core.Env.currentEnv() != null) {
080:                    throw new ODMGRuntimeException(
081:                            "Method must not be called from inside an ozone database object.");
082:                }
083:
084:                DxIterator it = dbs.iterator();
085:                while (it.next() != null) {
086:                    OzoneODMGDatabase db = (OzoneODMGDatabase) it.object();
087:                    if (db.containsObject(obj)) {
088:                        return db;
089:                    }
090:                }
091:                return null;
092:            }
093:
094:            /**
095:             * Create a <code>Transaction</code> object and associate it with the
096:             * current thread.
097:             * @return The newly created <code>Transaction</code> instance.
098:             * @see org.odmg.Transaction
099:             */
100:            public Transaction newTransaction() {
101:                if (org.ozoneDB.core.Env.currentEnv() != null) {
102:                    throw new ODMGRuntimeException(
103:                            "Method must not be called from inside an ozone database object.");
104:                }
105:                return new OzoneODMGTransaction(dbs);
106:            }
107:
108:            /**
109:             * Get the current <code>Transaction</code> for the thread.
110:             * @return The current <code>Transaction</code> object or null if there is none.
111:             * @see org.odmg.Transaction
112:             */
113:            public Transaction currentTransaction() {
114:                if (org.ozoneDB.core.Env.currentEnv() != null) {
115:                    throw new ODMGRuntimeException(
116:                            "Method must not be called from inside an ozone database object.");
117:                }
118:                return OzoneODMGTransaction.current();
119:            }
120:
121:            /**
122:             * Get a <code>String</code> representation of the object's identifier.
123:             * @param obj The object whose identifier is being accessed.
124:             * @return The object's identifier in the form of a String
125:             */
126:            public String getObjectId(Object obj) {
127:                if (org.ozoneDB.core.Env.currentEnv() != null) {
128:                    throw new ODMGRuntimeException(
129:                            "Method must not be called from inside an ozone database object.");
130:                }
131:
132:                throw new RuntimeException("Method not implemented yet.");
133:            }
134:
135:            /**
136:             * Create a new <code>OQLQuery</code> object.
137:             * @return The new <code>OQLQuery</code> object.
138:             * @see org.odmg.OQLQuery
139:             */
140:            public OQLQuery newOQLQuery() {
141:                throw new RuntimeException(
142:                        "newOQLQuery(): ozone does not implement OQL.");
143:            }
144:
145:            /**
146:             * Create a new <code>DList</code> object.
147:             * @return The new <code>DList</code> object.
148:             * @see org.odmg.DList
149:             */
150:            public DList newDList() {
151:                if (org.ozoneDB.core.Env.currentEnv() != null) {
152:                    throw new ODMGRuntimeException(
153:                            "Method must not be called from inside an ozone database object.");
154:                }
155:                return new OzoneODMGDList();
156:            }
157:
158:            /**
159:             * Create a new <code>DBag</code> object.
160:             * @return The new <code>DBag</code> object.
161:             * @see org.odmg.DBag
162:             */
163:            public DBag newDBag() {
164:                if (org.ozoneDB.core.Env.currentEnv() != null) {
165:                    throw new ODMGRuntimeException(
166:                            "Method must not be called from inside an ozone database object.");
167:                }
168:                return new OzoneODMGDBag();
169:            }
170:
171:            /**
172:             * Create a new <code>DSet</code> object.
173:             * @return The new <code>DSet</code> object.
174:             * @see org.odmg.DSet
175:             */
176:            public DSet newDSet() {
177:                if (org.ozoneDB.core.Env.currentEnv() != null) {
178:                    throw new ODMGRuntimeException(
179:                            "Method must not be called from inside an ozone database object.");
180:                }
181:                return new OzoneODMGDSet();
182:            }
183:
184:            /**
185:             * Create a new <code>DArray</code> object.
186:             * @return The new <code>DArray</code> object.
187:             * @see org.odmg.DArray
188:             */
189:            public DArray newDArray() {
190:                if (org.ozoneDB.core.Env.currentEnv() != null) {
191:                    throw new ODMGRuntimeException(
192:                            "Method must not be called from inside an ozone database object.");
193:                }
194:                return new OzoneODMGDArray();
195:            }
196:
197:            /**
198:             * Create a new <code>DMap</code> object.
199:             * @return	The new <code>DMap</code> object.
200:             * @see org.odmg.DMap
201:             */
202:            public DMap newDMap() {
203:                throw new RuntimeException("Method not implemented yet");
204:            }
205:
206:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.