org.ozoneDB

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 
org.ozoneDB
Provides the classes and interfaces of the native ozone API. The most important interfaces and classes are {@link org.ozoneDB.OzoneInterface}, which is the basic ozone API; and {@link org.ozoneDB.OzoneCompatible} / {@link org.ozoneDB.OzoneObject}, which are the base interface and a base class of all database objects.

Package Specification

Several implementations of OzoneInterface

Several classes implement the {@link OzoneInterface} interface. There are two situations where the programmer has to use this interface. Firstly, in the client to directly access database function such as {@link org.ozoneDB.OzoneInterface#createObject}. Secondly, inside the code of database classes (classes that are derived from {@link org.ozoneDB.OzoneCompatible}).

{@link Database} is the implementation of {@link OzoneInterface} that database objects obtain from their {@link org.ozoneDB.OzoneCompatible#database} method. The programmer should never need to create instances of this class.

All other implementations of {@link OzoneInterface} are derived from {@link org.ozoneDB.ExternalDatabase}. They can be used by the programmer to access a database from the client. The different classes provide different access modes to a database server but implement exactly the same interface. So in most cases the same code (except for the initialization of the database object) runs with different types of database.

{@link org.ozoneDB.RemoteDatabase} is used to access a remote database server over a socket connection. The server may reside on the same or a remote host.

{@link org.ozoneDB.LocalDatabase} is used to access a database server that resides in the same JVM as the client. Of course this does not allow multiple clients to access the server but it is faster and smaller.

{@link org.ozoneDB.ClientCacheDatabase} Maybe a cool thing that is not yet ready to be used and not yet documented.

Proxy objects

A Proxy object represents an actual database object inside client applications and inside other database objects. A proxy object can be seen as a persistent reference.

Proxy classes are generated out of the database classes. Database objects are persistent objects that run inside the server. All database classes implements the {@link org.ozoneDB.OzoneCompatible} interface. Database classes are by convention named *Impl. An external interface which extends {@link org.ozoneDB.OzoneRemote} describes the public interface of each database object. The Ozone Post Processor (OPP) tool generates the proxies out of the database classes. Proxy classes are named *Impl_Proxy.

Both database objects and proxies implement the public interface of the database object. All ozone API methods return proxies for the actual database object inside the database. So the client only deals with proxies. However the proxies provide the same interface and can be used as if they were the actual database objects.

Server side logic

ozone follows the OO paradigm that data and the corresponding operations together are objects. ozone does not only store the data of the objects but also provides an runtime environment to actually execute the methods of the database object. After invoking a method on a proxy object the parameters are marshalled and sent to the server where the corresponding method of the actual database object is invoked.

Of course, this is a time consuming operation. But in most cases this has to be done only once per 'business method' or 'business transaction'. An example: There are two business objects: UserManager and User which we want to make persistent. The UserManager holds the Users in a hashmap with the usernames as keys. Both classes, UserManager and User, have to be database objects. UserManager provides a method addUser(Name, Age, whatever) which creates a new user, fills the new object with the specified data and put it in the hashmap. Filling the User object with the data may result in many method calls. Since the User is a database object the UserManager only deals with proxies of the User database objects. So the method calls are handled via proxy objects. However, the UserManager itself is a database object and invoking a proxy from another database object (from inside the server) is much (around 1000 times) faster than invoking a database object from outside the server. Therefore it is very important to keep the ozone architecture in mind when designing and implementing an ozone application!

Transactions

By default, each client side invocation of a proxy method creates a new transaction. This transaction is implicitely aborted if the method throws an exception and commited otherwise. In the above UserManager example this is exactly what we need. Creating the new User object, filling it with data and storing it in the hashmap should run in one transaction. So the example runs as fast as possible and is transactionally correct. Or better: it runs fast because it is transactionally correct!

This means, if possible, do not use explicit transaction demarcation. This will force you to put the code that should run inside one transaction, inside one database object method, which leads to good performance!

Java Source File NameTypeComment
AbstractDatabase.javaClass Implementation of methods common to subclasses.
AbstractTransaction.javaClass Abstract base class of all external transaction classes.
CacheObjectContainer.javaClass An implementation of ObjectContainer that works together with ClientCacheDatabase to provide an client site cache.
ClassNotFoundExc.javaClass This exception is thrown, if ozone is unable to load a specified class.
ClientCacheDatabase.javaClass This is an ExternalDatabase that implements a client side cache on top of another ExternalDatabase .

In contrast to LocalDatabase and RemoteDatabase which produce the exactly same results for the same code, this implementation of ExternalDatabase is not guaranteed to do so.

Note: The method parameters of type OzoneRemote are supposed to by proxy objects (of type OzoneProxy ).

Database.javaClass This class represents the database for OzoneObjects within the server.

Note: The method parameters of type OzoneRemote are supposed to by proxy objects (of type OzoneProxy ).

DbNotOpenExc.javaClass
DeadlockExc.javaClass This exception is thrown in the client, if the current transaction was aborted because of a deadlock in the server.
ExceptionInOzoneObjectException.javaClass represents an exception which was thrown within a method of an OzoneObject.
ExternalDatabase.javaClass Base class for implementations of the OzoneInterface which are used from a client application to access an ozone.

Each thread is associated with a server connection.

ExternalTransaction.javaClass ExternalTransaction allows an application to explicitly manage transaction boundaries.

When programming ozone applications explicite transaction demarcation is needed under rare circumstances only (for example: processing of binary large objects - BLOBs).

LocalDatabase.javaClass This class represents a local database server that runs inside the same JVM as the client.
MethodNotFoundExc.javaClass This error is thrown, if the RMI system is unable to find or unable to invoke a given method.
ObjectNotFoundExc.javaClass This exception is thrown, if a database object, which is referenced by a proxy, cannot be found in the database.
OzoneCompatible.javaInterface All objects that are stored in ozone have to implement this interface.
OzoneCompatibleOrProxy.javaInterface This interface marks classes which represent objects which represent OzoneCompatibleOrProxy.OzoneObject s, either locally or remote.
OzoneInterface.javaInterface Together with ExternalTransaction and OzoneCompatible this interface represents the basic API of the ozone database system.
OzoneInternalExc.javaClass This exception signals an internal server exception.
OzoneObject.javaClass This class can be extended to build actual database objects.
OzoneProxy.javaClass Proxy of an OzoneRemote object.
OzoneRemote.javaInterface This interface is implemented by database classes ( OzoneCompatible ) and proxies ( OzoneProxy ).
OzoneRemoteExc.javaClass Base class of all exceptions that may be thrown by ozone API methods.
PermissionDeniedExc.javaClass This exception is thrown, if the owner of a transaction does not have proper permissions for a requested operation.
RemoteDatabase.javaClass This class represents a remote database server that is connected via a network connection.
Setup.javaClass Setup holds all static configuration properties plus all dynamic runtime properties of an ozone environment.
TransactionExc.javaClass This exception is thrown, if...
UnexpectedException.javaClass This Exception is thrown, if a method of a database object has thrown an exception that is not in its throws clause or to signal an general unexpected error condition.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.