Java Doc for ObjectTracker.java in  » Database-ORM » beankeeper » hu » netmind » persistence » 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 ORM » beankeeper » hu.netmind.persistence 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   hu.netmind.persistence.ObjectTracker

ObjectTracker
public class ObjectTracker implements TransactionListener,WeakMapListener(Code)
This class tracks objects' ids and values for different transactions. Basically this tracker can answer questions about the state of a previously registered object.

author:
   Brautigam Robert
version:
   Revision: $Revision$

Inner Class :public class ObjectData implements Comparable
Inner Class :public class SharedData
Inner Class :public class ObjectWrapper


Constructor Summary
 ObjectTracker(StoreContext context)
    

Method Summary
public  booleanequals(Object o1, Object o2)
     Determines, whether two objects are of the same database instance. Two objects are the same, if their ids equal.
public  booleanexists(Object obj)
     Determine whether an object exists. True, if object exists in store.
public  ObjectgetAttributeValue(Object obj, String attributeName)
     Return the attribute's last known value.
public  longgetIdentifier(Object obj)
     Get the identifier for a given object.
Parameters:
  obj - The object to identify.
public  PersistenceMetaDatagetMetaData(Object obj)
     Get the meta data associated with the object.
public  ObjectDatagetObjectData(Object obj)
     Get the data structure for an object.
public static  ObjectgetTypeValue(Object value, Class attrClass)
     Convert a value of a type to a given target type.
public  ObjectWrappergetWrapper(Object obj)
     Get an object wrapper for an object which disregards object's own equals() and hashCode() methods.
public  booleanhasChanged(ClassInfo info, Object obj, String attributeName, Map dbAttributes)
     Return whether a given attribute of a given object changed.
public  voidmakeExist(Object obj)
     Mark object as existent.
public  voidmakeUnexist(Object obj)
     Mark an object as non-existent.
public  voidnotifyValueLeave(Object id)
     Called when an object leaves the weak map.
public  voidregisterObject(Object obj, long id)
     Register an object into the tracker.
public  voidtransactionCommited(Transaction transaction)
     Called, when transaction tracker commits a transaction successfully.
public  voidtransactionRolledback(Transaction transaction)
     Called, when transaction tracker rolls back a transaction successfully.
public  voidupdateAttribute(Object obj, String identifier, Object value)
     Update a single attribute.
public  voidupdateObject(Object obj, Map changes)
     Update the attribute's known values with those given.


Constructor Detail
ObjectTracker
ObjectTracker(StoreContext context)(Code)




Method Detail
equals
public boolean equals(Object o1, Object o2)(Code)
Determines, whether two objects are of the same database instance. Two objects are the same, if their ids equal. Note however, that they do not need to contain the same values, or be of same version!



exists
public boolean exists(Object obj)(Code)
Determine whether an object exists. True, if object exists in store. This means that searcheswill return the object. If this is false, the object cannot befound yet.



getAttributeValue
public Object getAttributeValue(Object obj, String attributeName)(Code)
Return the attribute's last known value. The last known value is determined as follows: If the value changed during current transaction, the new value is returned, or else the last known saved value is returned. That means, if a transaction currently changes this attribute, another transaction will see the old value until the first transaction commits.



getIdentifier
public long getIdentifier(Object obj)(Code)
Get the identifier for a given object.
Parameters:
  obj - The object to identify. The identifier, or 0 if the object is not registered.



getMetaData
public PersistenceMetaData getMetaData(Object obj)(Code)
Get the meta data associated with the object.



getObjectData
public ObjectData getObjectData(Object obj)(Code)
Get the data structure for an object.



getTypeValue
public static Object getTypeValue(Object value, Class attrClass)(Code)
Convert a value of a type to a given target type.



getWrapper
public ObjectWrapper getWrapper(Object obj)(Code)
Get an object wrapper for an object which disregards object's own equals() and hashCode() methods.



hasChanged
public boolean hasChanged(ClassInfo info, Object obj, String attributeName, Map dbAttributes)(Code)
Return whether a given attribute of a given object changed.



makeExist
public void makeExist(Object obj)(Code)
Mark object as existent. If this is inside a transaction, the existence will only be permanent, if object is saved inside the transaction.



makeUnexist
public void makeUnexist(Object obj)(Code)
Mark an object as non-existent. This happens, if the object gets deleted, but there are some object instances that are used.



notifyValueLeave
public void notifyValueLeave(Object id)(Code)
Called when an object leaves the weak map. Note: This is thread-safe because it is called from WeakMap, which is handled safely in this class.



registerObject
public void registerObject(Object obj, long id)(Code)
Register an object into the tracker. This means, the object will get an id, and associated tracking data structure will be allocated.
Parameters:
  obj - The object to register.
Parameters:
  id - The id of object. If this is given (not 0), the object is assumed to exist.



transactionCommited
public void transactionCommited(Transaction transaction)(Code)
Called, when transaction tracker commits a transaction successfully. This tracker uses it to set object to exists and not exists state.
Parameters:
  transaction - The transaction which committed.



transactionRolledback
public void transactionRolledback(Transaction transaction)(Code)
Called, when transaction tracker rolls back a transaction successfully.
Parameters:
  transaction - The transaction which rolled back.



updateAttribute
public void updateAttribute(Object obj, String identifier, Object value)(Code)
Update a single attribute. This method simply calls updateObject().



updateObject
public void updateObject(Object obj, Map changes)(Code)
Update the attribute's known values with those given. Note, that this method will first make the changes only in current transaction, and only publish them when the current transaction commits.



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.