Java Doc for LockTracker.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.LockTracker

LockTracker
public class LockTracker (Code)
This class tracks locks on objects. Any persistable object can be locked, just like with the synchronized keyword in Java, and it does roughly the same thing too. If an object is locked, no database operations can occur outside of the lock owner transaction. All Store operations automatically try to lock the objects they work with, so there can't be any concurrent modifications.
You can also lock classes or interfaces. These equal to locking database tables, only they are hierarchical. That means, if you lock a class, all subclasses will also be locked automatically. For example, if you lock Object.class successfully, then only the owner of that lock will be able to modify anything. Of course, a class can't be locked, if there is another thread which holds lock on any super-, or sub-classes, or an instances of this class, or any subclass.
author:
   Brautigam Robert
version:
   Revision: $Revision$



Constructor Summary
public  LockTracker(StoreContext context)
    

Method Summary
public  SessionInfoProvidergetProvider()
    
public  voidlock(Object obj)
     Lock a single object.
public  voidlock(Object obj, int wait)
     Lock a single object with wait period given.
public  voidlock(Object obj, SessionInfo info)
     Lock a single object with the session information given.
public  voidlock(Object[] objs)
     Lock multiple objects.
public  voidlock(Object[] objs, int wait)
     Lock multiple objects.
public synchronized  voidlock(Object[] objs, SessionInfo info, int wait, boolean ensureCurrent)
     Lock multiple objects with all possible parameters specified. Use this method, if you want to lock multiple objects at the same time. If classes are asked to be ensured to be current, the following date is taken into account:
  • If the lock is called from inside a transaction, the transaction's first operation's date is taken.
  • If there are regular objects with this lock call, then the oldest object's read date is taken.
Whichever was earlier, the classes are checked against that date.
Parameters:
  objs - The object to lock simultaniously.
Parameters:
  info - The session info to memorize for this lock.
public  voidlockEnsureCurrent(Object obj)
     Lock a single object, and ensure that the object given is the most recent version of the object.
public  voidlockEnsureCurrent(Object obj, int wait)
     Lock a single object, and guarantee it's current.
public  voidlockEnsureCurrent(Object obj, SessionInfo info)
     Lock a single object with the session information given, and check is the given object is the current version.
public  voidlockEnsureCurrent(Object[] objs)
     Lock multiple objects, and check whether given objects are current.
public  voidlockEnsureCurrent(Object[] objs, int wait)
     Lock multiple objects, and check whether given objects are current.
public  voidsetProvider(SessionInfoProvider provider)
    
public  voidunlock(Object obj)
     Unlock a single object.
public synchronized  voidunlock(Object[] objs)
     Unlock multiple objects.


Constructor Detail
LockTracker
public LockTracker(StoreContext context)(Code)




Method Detail
getProvider
public SessionInfoProvider getProvider()(Code)



lock
public void lock(Object obj)(Code)
Lock a single object. The session information is gathered from the session info provider.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lock
public void lock(Object obj, int wait)(Code)
Lock a single object with wait period given. The session information is gathered from the session info provider.
Parameters:
  obj - The object to lock.
Parameters:
  wait - Wait the given amount of milliseconds for the lock tofree up. Method only throws ConcurrentModificationException ifthe lock is not available in the given time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lock
public void lock(Object obj, SessionInfo info)(Code)
Lock a single object with the session information given.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lock
public void lock(Object[] objs)(Code)
Lock multiple objects. The session information is gathered from the session info provider. Use this method, if you want to lock multiple objects at the same time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lock
public void lock(Object[] objs, int wait)(Code)
Lock multiple objects. The session information is gathered from the session info provider. Use this method, if you want to lock multiple objects at the same time.
Parameters:
  wait - Wait the given amount of milliseconds for the lock tofree up. Method only throws ConcurrentModificationException ifthe lock is not available in the given time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lock
public synchronized void lock(Object[] objs, SessionInfo info, int wait, boolean ensureCurrent)(Code)
Lock multiple objects with all possible parameters specified. Use this method, if you want to lock multiple objects at the same time. If classes are asked to be ensured to be current, the following date is taken into account:
  • If the lock is called from inside a transaction, the transaction's first operation's date is taken.
  • If there are regular objects with this lock call, then the oldest object's read date is taken.
Whichever was earlier, the classes are checked against that date.
Parameters:
  objs - The object to lock simultaniously.
Parameters:
  info - The session info to memorize for this lock. This object willbe included in the ConcurrentModificationException.
Parameters:
  wait - Wait the given amount of milliseconds for the lock tofree up. Method only throws ConcurrentModificationException ifthe lock is not available in the given time.
Parameters:
  ensureCurrent - Do the objects need to be guaranteed to be current.If this flag is set, the lock operation will fail, if any suppliedobject has a newer version.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another process.



lockEnsureCurrent
public void lockEnsureCurrent(Object obj)(Code)
Lock a single object, and ensure that the object given is the most recent version of the object. The session information is gathered from the session info provider.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lockEnsureCurrent
public void lockEnsureCurrent(Object obj, int wait)(Code)
Lock a single object, and guarantee it's current. The session information is gathered from the session info provider.
Parameters:
  obj - The object to lock.
Parameters:
  wait - Wait the given amount of milliseconds for the lock tofree up. Method only throws ConcurrentModificationException ifthe lock is not available in the given time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lockEnsureCurrent
public void lockEnsureCurrent(Object obj, SessionInfo info)(Code)
Lock a single object with the session information given, and check is the given object is the current version.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lockEnsureCurrent
public void lockEnsureCurrent(Object[] objs)(Code)
Lock multiple objects, and check whether given objects are current. The session information is gathered from the session info provider. Use this method, if you want to lock multiple objects at the same time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



lockEnsureCurrent
public void lockEnsureCurrent(Object[] objs, int wait)(Code)
Lock multiple objects, and check whether given objects are current. The session information is gathered from the session info provider. Use this method, if you want to lock multiple objects at the same time.
Parameters:
  wait - Wait the given amount of milliseconds for the lock tofree up. Method only throws ConcurrentModificationException ifthe lock is not available in the given time.
throws:
  ConcurrentModificationException - If the object is alreadylocked by another thread.



setProvider
public void setProvider(SessionInfoProvider provider)(Code)



unlock
public void unlock(Object obj)(Code)
Unlock a single object. If the object is not locked, nothing is done.



unlock
public synchronized void unlock(Object[] objs)(Code)
Unlock multiple objects.



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.