Java Doc for MultiLevelLock2.java in  » Database-JDBC-Connection-Pool » Apache-commons-transaction-1.2 » org » apache » commons » transaction » locking » 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 JDBC Connection Pool » Apache commons transaction 1.2 » org.apache.commons.transaction.locking 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.transaction.locking.MultiLevelLock2

All known Subclasses:   org.apache.commons.transaction.locking.GenericLock,
MultiLevelLock2
public interface MultiLevelLock2 extends MultiLevelLock(Code)
Extended multi level lock. Compared to basic MultiLevelLock allows for more flexible locking including preference and more compatibility modes.
version:
   $Id: MultiLevelLock2.java 493628 2007-01-07 01:42:48Z joerg $
See Also:   LockManager2
See Also:   MultiLevelLock
See Also:   GenericLock
since:
   1.1


Field Summary
final public static  intCOMPATIBILITY_NONE
     Compatibility mode: none reentrant.
final public static  intCOMPATIBILITY_REENTRANT
     Compatibility mode: reentrant.
final public static  intCOMPATIBILITY_REENTRANT_AND_SUPPORT
     Compatibility mode: reentrant and supporting.
final public static  intCOMPATIBILITY_SUPPORT
     Compatibility mode: supporting.


Method Summary
public  booleanacquire(Object ownerId, int targetLockLevel, boolean wait, int compatibility, boolean preferred, long timeoutMSecs)
     Tries to acquire a certain lock level on this lock.
public  booleanhas(Object ownerId, int lockLevel)
     Tests if a certain lock level is owned by an owner.
public  booleantest(Object ownerId, int targetLockLevel, int compatibility)
     Tests if a certain lock level could be acquired.

Field Detail
COMPATIBILITY_NONE
final public static int COMPATIBILITY_NONE(Code)
Compatibility mode: none reentrant. Lock level by the same owner shall affect compatibility.



COMPATIBILITY_REENTRANT
final public static int COMPATIBILITY_REENTRANT(Code)
Compatibility mode: reentrant. Lock level by the same owner shall not affect compatibility.



COMPATIBILITY_REENTRANT_AND_SUPPORT
final public static int COMPATIBILITY_REENTRANT_AND_SUPPORT(Code)
Compatibility mode: reentrant and supporting. Lock levels that are the same as the desired and lock levels held by the same owner shall not affect compatibility.



COMPATIBILITY_SUPPORT
final public static int COMPATIBILITY_SUPPORT(Code)
Compatibility mode: supporting. Lock levels that are the same as the desired shall not affect compatibility, but lock level held by the same owner shall.





Method Detail
acquire
public boolean acquire(Object ownerId, int targetLockLevel, boolean wait, int compatibility, boolean preferred, long timeoutMSecs) throws InterruptedException(Code)
Tries to acquire a certain lock level on this lock. Does the same as org.apache.commons.transaction.locking.MultiLevelLock.acquire(java.lang.Objectintbooleanbooleanlong) except that it allows for different compatibility settings. There is an additional compatibility mode MultiLevelLock2.COMPATIBILITY_SUPPORT that allows equal lock levels not to interfere with each other. This is like an additional shared compatibility and useful when you only want to make sure not to interfer with lowe levels, but are fine with the same.
Parameters:
  ownerId - a unique id identifying the entity that wants to acquire a certain lock level on this lock
Parameters:
  targetLockLevel - the lock level to acquire
Parameters:
  wait - true if this method shall block when the desired lock level can not be acquired
Parameters:
  compatibility - MultiLevelLock2.COMPATIBILITY_NONEif no additional compatibility isdesired (same as reentrant set to false) ,MultiLevelLock2.COMPATIBILITY_REENTRANTif lock level by the sameowner shall not affect compatibility (same as reentrant set totrue), or MultiLevelLock2.COMPATIBILITY_SUPPORTif lock levels thatare the same as the desired shall not affect compatibility, orfinally MultiLevelLock2.COMPATIBILITY_REENTRANT_AND_SUPPORTwhich isa combination of reentrant and support
Parameters:
  preferred - in case this lock request is incompatible with existing onesand we wait, it shall be granted before other waiting requeststhat are not preferred
Parameters:
  timeoutMSecs - if blocking is enabled by the wait parameter this specifies the maximum wait time in milliseconds true if the lock actually was acquired
throws:
  InterruptedException - when the thread waiting on this method is interrupted



has
public boolean has(Object ownerId, int lockLevel)(Code)
Tests if a certain lock level is owned by an owner.
Parameters:
  ownerId - a unique id identifying the entity that wants to check acertain lock level on this lock
Parameters:
  lockLevel - the lock level to test true if the lock could be acquired at the timethis method was called



test
public boolean test(Object ownerId, int targetLockLevel, int compatibility)(Code)
Tests if a certain lock level could be acquired. This method tests only and does not actually acquire the lock.
Parameters:
  ownerId - a unique id identifying the entity that wants to test acertain lock level on this lock
Parameters:
  targetLockLevel - the lock level to acquire
Parameters:
  compatibility - MultiLevelLock2.COMPATIBILITY_NONEif no additional compatibility isdesired (same as reentrant set to false) ,MultiLevelLock2.COMPATIBILITY_REENTRANTif lock level by the sameowner shall not affect compatibility (same as reentrant set totrue), or MultiLevelLock2.COMPATIBILITY_SUPPORTif lock levels thatare the same as the desired shall not affect compatibility, orfinally MultiLevelLock2.COMPATIBILITY_REENTRANT_AND_SUPPORTwhich isa combination of reentrant and support true if the lock could be acquired at the timethis method was called



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