Java Doc for LockFactory.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » services » locks » 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 DBMS » db derby 10.2 » org.apache.derby.iapi.services.locks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.services.locks.LockFactory

All known Subclasses:   org.apache.derby.impl.services.locks.SinglePool,
LockFactory
public interface LockFactory extends PropertySetCallback(Code)
Generic locking of objects. Enables deadlock detection.
MT - Mutable - Container Object - Thread Safe




Method Summary
public  booleananyoneBlocked()
    
public  booleanareLocksHeld(Object compatabilitySpace, Object group)
     Return true if locks are held in this compatability space and this group.
public  booleanareLocksHeld(Object compatabilitySpace)
     Return true if locks are held in this compatability space.
public  voidclearLimit(Object compatabilitySpace, Object group)
     Clear a limit set by setLimit.
public  booleanisLockHeld(Object compatabilitySpace, Object group, Lockable ref, Object qualifier)
     Check to see if a specific lock is held.
public  booleanlatchObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout)
     Latch an object.
public  booleanlockObject(Object compatabilitySpace, Object group, Lockable ref, Object qualifier, int timeout)
     Lock an object within a compatability space and associate the lock with a group object, waits up to timeout milli-seconds for the object to become unlocked.
public  booleanlockObject(Object group, Lockable ref, Object qualifier, int timeout, Latch latch)
     Lock an object within a compatability space and associate the lock with a group object, In addition a held latch is passed in.
public  EnumerationmakeVirtualLockTable()
     Make a virtual lock table for diagnostics.
public  voidsetLimit(Object compatabilitySpace, Object group, int limit, Limit callback)
     Install a limit that is called when the size of the group exceeds the required limit.
It is not guaranteed that the callback method (Limit.reached) is called as soon as the group size exceeds the given limit. If the callback method does not result in a decrease in the number of locks held then the lock factory implementation may delay calling the method again.
public  voidtransfer(Object compatabilitySpace, Object oldGroup, Object newGroup)
     Transfer a set of locks from one group to another.
public  voidunlatch(Latch heldLatch)
     Unlatch an object.
public  intunlock(Object compatabilitySpace, Object group, Lockable ref, Object qualifier)
     Unlock a single lock on a single object held within this compatability space that was locked with the supplied qualifier.
public  voidunlockGroup(Object compatabilitySpace, Object group)
     Unlock all locks in a group.
public  voidunlockGroup(Object compatabilitySpace, Object group, Matchable key)
     Unlock all locks on a group that match the passed in value.
public  booleanzeroDurationlockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout)
     Lock an object with zero duration within a compatability space, waits up to timeout milli-seconds for the object to become unlocked.



Method Detail
anyoneBlocked
public boolean anyoneBlocked()(Code)
Returns true if locks held by anyone are blocking anyone else



areLocksHeld
public boolean areLocksHeld(Object compatabilitySpace, Object group)(Code)
Return true if locks are held in this compatability space and this group.
Parameters:
  group - handle of group that objects were locked with.



areLocksHeld
public boolean areLocksHeld(Object compatabilitySpace)(Code)
Return true if locks are held in this compatability space.



clearLimit
public void clearLimit(Object compatabilitySpace, Object group)(Code)
Clear a limit set by setLimit.



isLockHeld
public boolean isLockHeld(Object compatabilitySpace, Object group, Lockable ref, Object qualifier)(Code)
Check to see if a specific lock is held.



latchObject
public boolean latchObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout) throws StandardException(Code)
Latch an object. A latch is a lock without a group. This means that it must be released explicitly by the owner. A latch is not released by any unlock methods, it must be released by the unlatch method. A latch is assumed to only be held by one locker at a time.
The first argument passed to lockEvent() is the Latch that is to be used in the unlatch() call. The firstArgument passed to unlockEvent() should be ignored. true if the latch was obtained,false if timeout is equal to LockFactory.NO_WAIT and the lock could not be granted.
exception:
  org.apache.derby.iapi.error.StandardException - A deadlock has occured (message id will be LockFactory.Deadlock)
exception:
  org.apache.derby.iapi.error.StandardException - Another thread interupted this thread whileit was waiting for the latch. This will be a StandardException with a nested java.lang.InterruptedException exception,(message id will be LockFactory.InterruptedExceptionId)
exception:
  StandardException - Standard Cloudscape error policy.



lockObject
public boolean lockObject(Object compatabilitySpace, Object group, Lockable ref, Object qualifier, int timeout) throws StandardException(Code)
Lock an object within a compatability space and associate the lock with a group object, waits up to timeout milli-seconds for the object to become unlocked. A timeout of 0 means do not wait for the lock to be unlocked. Note the actual time waited is approximate.

A compatibility space in an space where lock requests are assumed to be compatabile and granted by the lock manager if the trio {compatabilitySpace, ref, qualifier} are equal (i.e. reference equality for qualifier, equals() method for compatabilitySpace and ref ). A typical reference to use for the compatability space is a reference to an object representing a transaction. Granted by the lock manager means that the Lockable object may or may not be queried to see if the request is compatible.
A compatability space is not assumed to be owned by a single thread.
Parameters:
  compatabilitySpace - object defining compatability space (by value)
Parameters:
  group - handle of group, must be private to a thread.
Parameters:
  ref - reference to object to be locked
Parameters:
  qualifier - A qualification of the request.
Parameters:
  timeout - the maximum time to wait in milliseconds, LockFactory.NO_WAIT means don't wait. true if the lock was obtained, false if timeout is equal to LockFactory.NO_WAIT and the lockcould not be granted.
exception:
  org.apache.derby.iapi.error.StandardException - A deadlock has occured (message id will be LockFactory.Deadlock)
exception:
  org.apache.derby.iapi.error.StandardException - The wait for the lock timed out (message id will be LockFactory.TimeOut).
exception:
  org.apache.derby.iapi.error.StandardException - Another thread interupted this thread whileit was waiting for the lock. This will be a StandardException with a nested java.lang.InterruptedException exception,(message id will be LockFactory.InterruptedExceptionId)
exception:
  StandardException - Standard Cloudscape error policy.




lockObject
public boolean lockObject(Object group, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException(Code)
Lock an object within a compatability space and associate the lock with a group object, In addition a held latch is passed in. If the lock cannot be granted immediately, the latch will be released and relatched after the lock is obtained. If the lock can be granted immediately the latch is not released.
The compatability space of the request is defined by the compatability space of the latch.


Parameters:
  group - handle of group, must be private to a compatability space.
Parameters:
  ref - reference to object to be locked
Parameters:
  qualifier - A qualification of the request.
Parameters:
  timeout - amount of time to wait, NO_WAIT is not supported
Parameters:
  latch - latch to be atomically released/re-latched in a wait. true if the latch was released, false otherwise.
exception:
  org.apache.derby.iapi.error.StandardException - A deadlock has occured (message id will be LockFactory.Deadlock)
exception:
  org.apache.derby.iapi.error.StandardException - Another thread interupted this thread whileit was waiting for the lock. This will be a StandardException with a nested java.lang.InterruptedException exception,(message id will be LockFactory.InterruptedExceptionId)
exception:
  StandardException - Standard Cloudscape error policy.




makeVirtualLockTable
public Enumeration makeVirtualLockTable()(Code)
Make a virtual lock table for diagnostics.



setLimit
public void setLimit(Object compatabilitySpace, Object group, int limit, Limit callback)(Code)
Install a limit that is called when the size of the group exceeds the required limit.
It is not guaranteed that the callback method (Limit.reached) is called as soon as the group size exceeds the given limit. If the callback method does not result in a decrease in the number of locks held then the lock factory implementation may delay calling the method again. E.g. with a limit of 500 and a reached() method that does nothing, may result in the call back method only being called when the group size reaches 550.
Only one limit may be in place for a group at any time.
See Also:   Limit



transfer
public void transfer(Object compatabilitySpace, Object oldGroup, Object newGroup)(Code)
Transfer a set of locks from one group to another.



unlatch
public void unlatch(Latch heldLatch)(Code)
Unlatch an object.



unlock
public int unlock(Object compatabilitySpace, Object group, Lockable ref, Object qualifier)(Code)
Unlock a single lock on a single object held within this compatability space that was locked with the supplied qualifier.
Parameters:
  compatabilitySpace - object defining compatability space (by value)
Parameters:
  group - handle of group.
Parameters:
  ref - Reference to object to be unlocked.
Parameters:
  qualifier - qualifier of lock to be unlocked number of locks released (one or zero).



unlockGroup
public void unlockGroup(Object compatabilitySpace, Object group)(Code)
Unlock all locks in a group.
Parameters:
  group - handle of group that objects were locked with.



unlockGroup
public void unlockGroup(Object compatabilitySpace, Object group, Matchable key)(Code)
Unlock all locks on a group that match the passed in value.



zeroDurationlockObject
public boolean zeroDurationlockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout) throws StandardException(Code)
Lock an object with zero duration within a compatability space, waits up to timeout milli-seconds for the object to become unlocked. A timeout of 0 means do not wait for the lock to be unlocked. Note the actual time waited is approximate.

Zero duration means the lock is released as soon as it is obtained.

A compatibility space in an space where lock requests are assumed to be compatabile and granted by the lock manager if the trio {compatabilitySpace, ref, qualifier} are equal (i.e. reference equality for qualifier, equals() method for compatabilitySpace and ref ). A typical reference to use for the compatability space is a reference to an object representing a transaction. Granted by the lock manager means that the Lockable object may or may not be queried to see if the request is compatible.
A compatability space is not assumed to be owned by a single thread.
Parameters:
  compatabilitySpace - object defining compatability space (by value)
Parameters:
  ref - reference to object to be locked
Parameters:
  qualifier - A qualification of the request.
Parameters:
  timeout - the maximum time to wait in milliseconds, LockFactory.NO_WAIT means don't wait. true if the lock was obtained, false if timeout is equal to LockFactory.NO_WAIT and the lockcould not be granted.
exception:
  org.apache.derby.iapi.error.StandardException - A deadlock has occured (message id will be LockFactory.Deadlock)
exception:
  org.apache.derby.iapi.error.StandardException - The wait for the lock timed out (message id will be LockFactory.TimeOut).
exception:
  org.apache.derby.iapi.error.StandardException - Another thread interupted this thread whileit was waiting for the lock. This will be a StandardException with a nested java.lang.InterruptedException exception,(message id will be LockFactory.InterruptedExceptionId)
exception:
  StandardException - Standard Cloudscape error policy.




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