Java Doc for TransactionManager.java in  » ERP-CRM-Financial » jmoney » net » sf » jmoney » isolation » 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 » ERP CRM Financial » jmoney » net.sf.jmoney.isolation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.jmoney.model2.DataManager
      net.sf.jmoney.isolation.TransactionManager

TransactionManager
public class TransactionManager extends DataManager (Code)
A transaction manager must be set before the datastore can be modified. An exception will be throw if an attempt is made to modify the datastore (setting a property, or creating or deleting an extendable object) when no transaction manager is set in the session.

Changes to the datastore are stored in the transaction manager. They are not applied to the underlying datastore until the transaction is committed. Read accesses (property getters and queries) are passed on to any transaction manager which will modify the results to reflect changes stored in the transaction.
author:
   Nigel Westbury


Inner Class :class DeletedObject

Field Summary
 Map<IObjectKey, ExtendableObject>allObjects
     Every extendable object that has ever been created in this transaction and passed to the user is in this map.
 Set<DeltaListManager>modifiedLists
     Every list that has been modified by this transaction manager (objects added to the list or objects removed from the list) will have an entry in this set.
 Map<IObjectKey, ModifiedObject>modifiedObjects
     Maps IObjectKey to Map, where IObjectKey is the key in the comitted datastore and each Map maps PropertyAccessor to the value of that property.

Constructor Summary
public  TransactionManager(DataManager baseDataManager)
     Construct a transaction manager for use with the given session. The transaction manager does not become the active transaction manager for the session until it is specifically set as the active transaction manager.

Method Summary
public  voidcommit()
     Apply the changes that are stored in this transaction manager.
public  voidcommit(String label)
     This method does the same as the commit() method but the changes may be undone and redone.
public  voidcommitTransaction()
     This method is called when a nested transaction manager has completed making changes to our data.
public  ObjectgetAdapter(Class adapter)
    
public  EgetCopyInTransaction(E committedObject)
     Given an instance of an object in the datastore (i.e.
public  Collection<Entry>getEntries(Account account)
    
public  SessiongetSession()
    
public  booleanhasChanges()
     Indicate whether there are any uncommitted changes being held by this transaction manager.
public  booleanhasEntries(Account account)
    
public  voidstartTransaction()
     This method is called when a nested transaction manager is about to apply its changes to our data.

Field Detail
allObjects
Map<IObjectKey, ExtendableObject> allObjects(Code)
Every extendable object that has ever been created in this transaction and passed to the user is in this map. This is required because all DataManager objects must guarantee that there is only ever a single instance of an object in existence. Objects that were created in this transaction are not in this map. There is only one instance of such objects in any case, so only that one instance would be returned. The object key is the key in the committed datastore. Only objects that exist in the underlying datastore are in this map, and it is just easier to use the committed key than to use an uncommitted key.



modifiedLists
Set<DeltaListManager> modifiedLists(Code)
Every list that has been modified by this transaction manager (objects added to the list or objects removed from the list) will have an entry in this set. This enables the transaction manager to easily find the added and deleted objects when committing the changes.



modifiedObjects
Map<IObjectKey, ModifiedObject> modifiedObjects(Code)
Maps IObjectKey to Map, where IObjectKey is the key in the comitted datastore and each Map maps PropertyAccessor to the value of that property. Every object that has been modified by this transaction manager (a scalar property in the object has been changed) will have an entry in this map. The map keys are objects from the datastore and will contain the property values that are currently committed in the datastore. The map values are objects that contain details of the changes (changed scalar property values, or an indication that the object has been deleted).

If a value of a property is a reference to another object then an UncommittedObjectKey is stored as the value. By doing this, the referenced object does not need to be materialized unless necessary.

Deleted objects will also have an entry in this map. If an object contains list properties and the object is deleted then all the objects in the lists will also be added to this map with a ModifiedObject that has a 'deleted' indication. This is necessary because this list is used to determine if an object has been deleted, to ensure that we do not attempt to modify a property value in an object that has in fact been deleted.





Constructor Detail
TransactionManager
public TransactionManager(DataManager baseDataManager)(Code)
Construct a transaction manager for use with the given session. The transaction manager does not become the active transaction manager for the session until it is specifically set as the active transaction manager. By separating the construction of the transaction manager from the activating of the transaction manager, a transaction manager can be created and listeners can be set up to listen to session changes within the transaction manager during an initialization stage even though the transaction is not made active until changes are made.
Parameters:
  session - the session object from the committed datastore




Method Detail
commit
public void commit()(Code)
Apply the changes that are stored in this transaction manager.

When changes are committed, they are seen in the datastore and also in the version of the datastore as seen through other transaction managers.

All datastore listeners and all listeners which are listening for changes ......




commit
public void commit(String label)(Code)
This method does the same as the commit() method but the changes may be undone and redone. This support is available with no coding needed by the caller other than to pass the label to be used to describe the operation.
Parameters:
  label - the label to be used to describe this operationfor undo/redo purposes



commitTransaction
public void commitTransaction()(Code)
This method is called when a nested transaction manager has completed making changes to our data.



getAdapter
public Object getAdapter(Class adapter)(Code)



getCopyInTransaction
public E getCopyInTransaction(E committedObject)(Code)
Given an instance of an object in the datastore (i.e. committed), obtain a copy of the object that is in the version of the datastore managed by this transaction manager.

Updates to property values in the returned object will not be applied to the datastore until the changes held by this transaction manager are committed to the datastore.
Parameters:
  an - object that exists in the datastore (committed) a copy of the given object, being an uncommitted versionof the object in this transaction, or null if thegiven object has been deleted in this transaction




getEntries
public Collection<Entry> getEntries(Account account)(Code)

Parameters:
  account -



getSession
public Session getSession()(Code)
a session object representing an uncommittedsession object managed by this transaction manager



hasChanges
public boolean hasChanges()(Code)
Indicate whether there are any uncommitted changes being held by this transaction manager. This method is useful when the user does something like selecting another transaction or closing a dialog box and it is not clear whether the user wants to commit or to cancel changes. true if property values have been changed or objectshave been created or deleted within the context of thistransaction manager since the last commit



hasEntries
public boolean hasEntries(Account account)(Code)

Parameters:
  account -



startTransaction
public void startTransaction()(Code)
This method is called when a nested transaction manager is about to apply its changes to our data.



Methods inherited from net.sf.jmoney.model2.DataManager
public void addChangeListener(SessionChangeListener listener)(Code)(Java Doc)
public void addChangeListener(SessionChangeListener listener, Control control)(Code)(Java Doc)
public void addChangeListenerWeakly(SessionChangeListener listener)(Code)(Java Doc)
public void addSessionChangeFirerListener(SessionChangeFirerListener listener)(Code)(Java Doc)
abstract public void commitTransaction()(Code)(Java Doc)
public void fireEvent(ISessionChangeFirer firer)(Code)(Java Doc)
abstract public Collection<Entry> getEntries(Account account)(Code)(Java Doc)
abstract public Session getSession()(Code)(Java Doc)
abstract public boolean hasEntries(Account account)(Code)(Java Doc)
public boolean isSessionFiring()(Code)(Java Doc)
public void removeChangeListener(SessionChangeListener listener)(Code)(Java Doc)
public void removeSessionChangeFirerListener(SessionChangeFirerListener listener)(Code)(Java Doc)
abstract public void startTransaction()(Code)(Java Doc)

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.