Source Code Cross Referenced for OzoneObject.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » 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 
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: OzoneObject.java,v 1.4 2002/07/12 09:25:11 mediumnet Exp $
008:
009:        package org.ozoneDB;
010:
011:        import org.ozoneDB.core.ObjectContainer;
012:        import org.ozoneDB.core.ObjectID;
013:        import org.xml.sax.ContentHandler;
014:        import org.xml.sax.SAXException;
015:
016:        /**
017:         * This class can be extended to build actual database objects. It provides a
018:         * default implementation of the {@link OzoneCompatible} interface.
019:         *
020:         * @author <a href="http://www.softwarebuero.de/">SMB</a>
021:         * @version $Revision: 1.4 $Date: 2002/07/12 09:25:11 $
022:         */
023:        public class OzoneObject implements  OzoneCompatible {
024:
025:            final static long serialVersionUID = 3171995582505722338L;
026:
027:            transient ObjectContainer container = null;
028:
029:            public int hashCode() {
030:                return container.id().hashCode();
031:            }
032:
033:            public synchronized void setContainer(ObjectContainer _container) {
034:                container = _container;
035:            }
036:
037:            public OzoneProxy self() {
038:                if (container == null) {
039:                    throw new RuntimeException(
040:                            "Object is not (yet) associated to a database container.");
041:                }
042:                return container.ozoneProxy();
043:            }
044:
045:            public ObjectContainer container() {
046:                if (container == null) {
047:                    throw new RuntimeException(
048:                            "Object is not (yet) associated to a database container.");
049:                }
050:                return container;
051:            }
052:
053:            /**
054:             * Retrieves a handle to a specific instance of an OzoneObject. A handle is
055:             * the externalizeable equivalent of OzoneProxy. The purpose of handles is to enable
056:             * detached systems (such as web interfaces) that are not able to use OzoneProxy
057:             * objects directly a means to access specific objects where object naming is not
058:             * practical or convenient. A handle is valid for the lifetime of
059:             * the OzoneObject it references. Unlike OzoneProxy, retrieving a handle on an
060:             * object does nothing to guarantee its existence. While the handle is valid
061:             * for the lifetime of the object it refers to, that object's lifetime may
062:             * be shorter than the handle's.
063:             *  <br><br>
064:             * The resultant string representation will be composed
065:             * entirely of alphanumeric characters [A-Z], [a-z], and [0-9]; as such,
066:             * it can safely and reliably be used in URLs without need for escaping.
067:             *
068:             */
069:            public String handle() {
070:                if (container == null) {
071:                    throw new RuntimeException(
072:                            "Object is not (yet) associated to a database container.");
073:                }
074:                return container.id().toString();
075:            }
076:
077:            public OzoneInterface database() {
078:                if (container == null) {
079:                    throw new RuntimeException(
080:                            "Object is not (yet) associated to a database container.");
081:                }
082:                return container.database();
083:            }
084:
085:            public String toString() {
086:                return "OzoneObject, ID: "
087:                        + (container != null ? container.id().toString()
088:                                : "null");
089:            }
090:
091:            /**
092:             * This default implementation of the onCreate() method does nothing.
093:             */
094:            public void onCreate() throws Exception {
095:            }
096:
097:            /**
098:             * This default implementation of the onDelete() method does nothing.
099:             */
100:            public void onDelete() throws Exception {
101:            }
102:
103:            // This Method is not needed anymore, because it is only used in ClassicStore
104:            /**
105:             * This default implementation of the size() method. It returns just -1 to
106:             * signal that a default value should be used.
107:             *
108:            public int size() throws Exception {
109:                return -1;
110:            }
111:             */
112:
113:            /**
114:             * This default implementation of the toSAX() method. It returns just false
115:             * to signal that a default value should be used.
116:             */
117:            public boolean toXML(ContentHandler ch) throws SAXException {
118:                return false;
119:            }
120:
121:            public void deleteRecursive() {
122:                throw new RuntimeException(
123:                        "deleteRecursive() is not implemented yet.");
124:            }
125:
126:            /**
127:              Returns the ObjectID of the represented ozone object. ObjectIDs are equal for equal
128:              ozone objects and different for different ozone objects. They are comparable, so that
129:              ozone objects may use {@link ObjectID#compareTo) in comparison functions.
130:              <P>
131:                Currently, ObjectID exposes other methods than {@link ObjectID#equals) and
132:                {@link ObjectID#compareTo). However, they should not be used, as ObjectIDs should
133:                be, apart from this methods, opaque.
134:              </P>
135:             */
136:            public ObjectID getObjectID() {
137:                return container.id();
138:            }
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.