Java Doc for ObjectLockFactory.java in  » Net » Coadunation_1.0.1 » com » rift » coad » util » lock » 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 » Net » Coadunation_1.0.1 » com.rift.coad.util.lock 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.rift.coad.util.lock.ObjectLockFactory

ObjectLockFactory
public class ObjectLockFactory (Code)
The object lock factory is responsible for assigning locks based on the object passed in. Object locks are designed to work in conjunction with transaction locks. They are designed to cater for named locks that are not thread id dependant. This means it is possible to lock an object until a transaction is complete, even though the transaction is being controlled from another and hense different threads. There are four different types of object locks; read lock, read named lock, write lock and a named write lock. All locks are re-entrant. Meaning they can be locked a number of times and must be unlocked the same number of times. If a read lock needs to change to a write lock, that lock must be released before this can be done otherwise a dead lock will occur. A write lock can change from a write thread id lock to a write thread named lock. A read lock cannot change from a thread id lock to a named id lock.
author:
   Brett Chaldecott

Inner Class :public class Lock
Inner Class :public class ObjectLockRef implements LockRef

Field Summary
final public static  intDO_NOT_WAIT
    
final public static  intWAIT
    
final public static  intWAIT_ON_NAMED
    
final public static  intWAIT_ON_THREAD
    
protected static  Loggerlog
    


Method Summary
public  LockRefacquireReadLock(Object key)
     This method creates a new lock for the specified key.
public  LockRefacquireReadLock(Object key, Object name)
     This method creates a new read lock for the specified key.
public  LockRefacquireWriteLock(Object key)
     This method creates a new lock for the specified key.
public  LockRefacquireWriteLock(Object key, int waitFlags)
     This method creates a new lock for the specified key.
public  LockRefacquireWriteLock(Object key, Object name)
     This method creates a new lock for the specified key.
public  LockRefacquireWriteLock(Object key, Object name, int waitFlags)
     This method creates a new lock for the specified key.
public static synchronized  voidfin()
     This method removes the object lock factory associated with a class loader.
public static synchronized  ObjectLockFactorygetInstance()
     This method returns the object lock factory singleton reference. The object lock factory singleton reference.
public static synchronized  voidinit()
     This method creates a new object lock factory singleton for a class loader.
public  voidreleaseLock(Object key)
     This method releases the lock held on a given object.
public  voidreleaseLock(Object key, Object name)
     This method releases the lock held on a given object.

Field Detail
DO_NOT_WAIT
final public static int DO_NOT_WAIT(Code)



WAIT
final public static int WAIT(Code)



WAIT_ON_NAMED
final public static int WAIT_ON_NAMED(Code)



WAIT_ON_THREAD
final public static int WAIT_ON_THREAD(Code)



log
protected static Logger log(Code)





Method Detail
acquireReadLock
public LockRef acquireReadLock(Object key) throws LockException(Code)
This method creates a new lock for the specified key. The object lock reference.
Parameters:
  key - The key to lock this object with.
exception:
  LockException -



acquireReadLock
public LockRef acquireReadLock(Object key, Object name) throws LockException(Code)
This method creates a new read lock for the specified key. The object lock reference.
Parameters:
  key - The key to lock this object with.
Parameters:
  name - The name ofthe lock.
exception:
  LockException -



acquireWriteLock
public LockRef acquireWriteLock(Object key) throws LockException(Code)
This method creates a new lock for the specified key. A reference to the lock object.
Parameters:
  key - The key that identifies the unique lock.
exception:
  LockException -



acquireWriteLock
public LockRef acquireWriteLock(Object key, int waitFlags) throws LockException, LockConflict(Code)
This method creates a new lock for the specified key. It will wait depending on the specified flag. The object lock reference.
Parameters:
  key - The key to lock this object with.
Parameters:
  waitFlags - The flags to wait on.
exception:
  LockException -
exception:
  LockConflict -



acquireWriteLock
public LockRef acquireWriteLock(Object key, Object name) throws LockException(Code)
This method creates a new lock for the specified key. The reference to the lock object.
Parameters:
  key - The key that the lock will be aquired for.
Parameters:
  name - The name of the lock.
exception:
  LockException -



acquireWriteLock
public LockRef acquireWriteLock(Object key, Object name, int waitFlags) throws LockException, LockConflict(Code)
This method creates a new lock for the specified key. It will wait depending on the specified flag. The object lock reference.
Parameters:
  key - The key to lock this object with.
Parameters:
  name - The name ofthe lock.
Parameters:
  waitFlags - The flags to wait on.
exception:
  LockException -
exception:
  LockConflict -



fin
public static synchronized void fin() throws LockException(Code)
This method removes the object lock factory associated with a class loader.
exception:
  LockException -



getInstance
public static synchronized ObjectLockFactory getInstance() throws LockException(Code)
This method returns the object lock factory singleton reference. The object lock factory singleton reference. LockException.



init
public static synchronized void init() throws LockException(Code)
This method creates a new object lock factory singleton for a class loader.
exception:
  LockException -



releaseLock
public void releaseLock(Object key) throws LockException(Code)
This method releases the lock held on a given object.
Parameters:
  key - The key identifying the lock.
exception:
  LockException -



releaseLock
public void releaseLock(Object key, Object name) throws LockException(Code)
This method releases the lock held on a given object.
Parameters:
  key - The key identifying the lock.
exception:
  LockException -



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.