Java Doc for CastorDatabase.java in  » Web-Mail » Jwma » dtw » webmail » util » 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 » Web Mail » Jwma » dtw.webmail.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   dtw.webmail.util.CastorDatabase

All known Subclasses:   dtw.webmail.plugin.std.JwmaDatabase,
CastorDatabase
abstract public class CastorDatabase (Code)
Abstract class that encapsulates a Database from the Castor lib, to enhance performance by adding the reuse of queries (which is perfectly possible).
author:
   Dieter Wimberger
version:
   0.9.7 07/02/2003


Field Summary
protected  Databasem_Database
    
protected  HashMapm_Queries
    

Constructor Summary
public  CastorDatabase()
     Simple and empty constructor, to create a lightweight instance that serves only as factory object for "real" instances.

Method Summary
public  voidbegin()
     Delegates beginning a new transaction to the encapsulated Database.
public  voidclose()
     Closes the database.
public  voidcommit()
     Delegates the commit method to the encapsulated Database instance.
public  voidcreate(Object object)
     Delegates creation of a new object in persistent storage to the encapsulated Database.
abstract public  CastorDatabasecreateCastorDatabase()
    
public  DatabasegetDatabase()
     Returns the encapsulated Database instance.
public  ObjectgetIdentity(Object object)
     Delegates checking an object's identity to the encapsulated Database.
Parameters:
  object - the object to be checked.
public  OQLQuerygetOQLQuery()
     Delegates creation of an OQL query with no statement.
public  OQLQuerygetOQLQuery(String oql)
     Delegates creation of an OQL query from the supplied statement.
public  OQLQuerygetQuery(String identifier)
    
public  booleanisActive()
     Tests if a transaction is currently active.
public  booleanisAutoStore()
     Delegates testing of the current transaction autoStore flag state to the encapsulated Database.
public  booleanisClosed()
     Tests if a database has been closed.
public  booleanisPersistent(Object object)
     Delegates testing of a given object's persistency state. An object is persistent if it was created or queried in this transaction.
public  Objectload(Class type, Object identity)
     Delegates loading of an object of the specified type and given identity to the encapsulated Database.
public  voidputQuery(String identifier, OQLQuery query)
    
public  voidremove(Object object)
     Delegates removal of the object from persistent storage.
public  voidrollback()
     Delegates the rollback method to the encapsulated Database instance.
public  voidsetAutoStore(boolean autoStore)
     Delegates setting of the autoStore flag state to the encapsulated Database.
public  voidupdate(Object object)
     Delegates updating a data object which is queried/loaded/created in another transaction to the encapsulated Database.

Field Detail
m_Database
protected Database m_Database(Code)



m_Queries
protected HashMap m_Queries(Code)




Constructor Detail
CastorDatabase
public CastorDatabase()(Code)
Simple and empty constructor, to create a lightweight instance that serves only as factory object for "real" instances.




Method Detail
begin
public void begin() throws PersistenceException(Code)
Delegates beginning a new transaction to the encapsulated Database. A transaction must be open in order to query and persist objects.
throws:
  PersistenceException - A transaction is already open onthis database, or an error reported by the persistence engine



close
public void close() throws PersistenceException(Code)
Closes the database. If a client transaction is in progress the transaction will be rolled back and an exception thrown. If an app-server transaction is in progress, the transaction will commit/rollback when triggered by the application server.
throws:
  PersistenceException - An error occured whileattempting to close the database



commit
public void commit() throws TransactionNotInProgressException, TransactionAbortedException(Code)
Delegates the commit method to the encapsulated Database instance.
throws:
  TransactionNotInProgressException - Method called whiletransaction is not in progress.
throws:
  TransactionAbortedException - The transaction cannotcommit and has been rolled back.



create
public void create(Object object) throws ClassNotPersistenceCapableException, DuplicateIdentityException, TransactionNotInProgressException, PersistenceException(Code)
Delegates creation of a new object in persistent storage to the encapsulated Database. The object will only be persisted if the transaction commits.
Parameters:
  object - The object to create
throws:
  TransactionNotInProgressException - Method called whiletransaction is not in progress.
throws:
  DuplicateIdentityException - An object with this identityalready exists in persistent storage
throws:
  ClassNotPersistenceCapableException - The class is notpersistent capable.
throws:
  PersistenceException - An error reported by thepersistence engine.



createCastorDatabase
abstract public CastorDatabase createCastorDatabase() throws JwmaException(Code)



getDatabase
public Database getDatabase()(Code)
Returns the encapsulated Database instance. the encapsulated database instance.



getIdentity
public Object getIdentity(Object object)(Code)
Delegates checking an object's identity to the encapsulated Database.
Parameters:
  object - the object to be checked. the object's identity, or null if nonexistant.



getOQLQuery
public OQLQuery getOQLQuery()(Code)
Delegates creation of an OQL query with no statement. OQLQuery.create must be called before the query can be executed. a new nonprepared OQL query.



getOQLQuery
public OQLQuery getOQLQuery(String oql) throws QueryException(Code)
Delegates creation of an OQL query from the supplied statement.
Parameters:
  query - An OQL query statement An OQL query
throws:
  QueryException - The query syntax is invalid



getQuery
public OQLQuery getQuery(String identifier)(Code)



isActive
public boolean isActive()(Code)
Tests if a transaction is currently active. true if a transaction is active, false otherwise.



isAutoStore
public boolean isAutoStore()(Code)
Delegates testing of the current transaction autoStore flag state to the encapsulated Database. true if autostoring is on, false otherwise.



isClosed
public boolean isClosed()(Code)
Tests if a database has been closed. true if the database has been closed, false otherwise.



isPersistent
public boolean isPersistent(Object object)(Code)
Delegates testing of a given object's persistency state. An object is persistent if it was created or queried in this transaction. If the object was created or queried in another transaction, or there is no open transaction, this method returns null(??).
Parameters:
  object - the object to be tested. True if persistent in this transaction



load
public Object load(Class type, Object identity) throws TransactionNotInProgressException, ObjectNotFoundException, LockNotGrantedException, PersistenceException(Code)
Delegates loading of an object of the specified type and given identity to the encapsulated Database.
Parameters:
  type - The object's type
Parameters:
  identity - The object's identity
throws:
  ObjectNotFoundException - No object of the given type andidentity was found in persistent storage.
throws:
  LockNotGrantedException - Timeout or deadlock occuredattempting to acquire a lock on the object.
throws:
  TransactionNotInProgressException - Method called whiletransaction is not in progress.
throws:
  PersistenceException - An error reported by thepersistence engine.



putQuery
public void putQuery(String identifier, OQLQuery query)(Code)



remove
public void remove(Object object) throws ObjectNotPersistentException, LockNotGrantedException, TransactionNotInProgressException, PersistenceException(Code)
Delegates removal of the object from persistent storage. The deletion will take effect only if the transaction is committed, but the object is no longer visible to queries in the current transaction and locks for access from other transactions will block until this transaction completes.
Parameters:
  object - The object to remove
throws:
  TransactionNotInProgressException - Method called whiletransaction is not in progress.
throws:
  ObjectNotPersistentException - The object has not beenqueried or created in this transaction.
throws:
  LockNotGrantedException - Timeout or deadlock occuredattempting to acquire a lock on the object.
throws:
  PersistenceException - An error reported by thepersistence engine.



rollback
public void rollback() throws TransactionNotInProgressException(Code)
Delegates the rollback method to the encapsulated Database instance.



setAutoStore
public void setAutoStore(boolean autoStore)(Code)
Delegates setting of the autoStore flag state to the encapsulated Database.
Parameters:
  autoStore - true if on, false otherwise.



update
public void update(Object object) throws ClassNotPersistenceCapableException, TransactionNotInProgressException, PersistenceException(Code)
Delegates updating a data object which is queried/loaded/created in another transaction to the encapsulated Database. This method is used only for long transaction support. Calling this method for data object queried/loaded/created in the same transaction results in Exception.
Parameters:
  object - The object to create
throws:
  TransactionNotInProgressException - Method called whiletransaction is not in progress.
throws:
  ClassNotPersistenceCapableException - The class is notpersistent capable.
throws:
  PersistenceException - An error reported by thepersistence engine.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.