Java Doc for LockManager.java in  » JMX » je » com » sleepycat » je » txn » 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 » JMX » je » com.sleepycat.je.txn 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sleepycat.je.txn.LockManager

All known Subclasses:   com.sleepycat.je.txn.DummyLockManager,  com.sleepycat.je.txn.LatchedLockManager,  com.sleepycat.je.txn.SyncedLockManager,
LockManager
abstract public class LockManager implements EnvConfigObserver(Code)
LockManager manages locks. Note that locks are counted as taking up part of the JE cache;

Inner Class :static class LockAttemptResult

Field Summary
final static  longTOTAL_LOCK_OVERHEAD
    
protected  Latch[]lockTableLatches
    
protected  intnLockTables
    

Constructor Summary
public  LockManager(EnvironmentImpl envImpl)
    

Method Summary
abstract protected  LockAttemptResultattemptLock(Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest)
    
protected  LockAttemptResultattemptLockInternal(Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest, int lockTableIndex)
    
abstract  voiddemote(long nodeId, Locker locker)
     Demote a lock from write to read.
protected  voiddemoteInternal(long nodeId, Locker locker, int lockTableIndex)
     Do the real work of demote.
public  voiddump()
    
abstract protected  voiddumpLockTable(LockStats stats)
     Dump the lock table to the lock stats.
protected  voiddumpLockTableInternal(LockStats stats, int i)
     Do the real work of dumpLockTableInternal.
public  StringdumpToString()
    
public  voidenvConfigUpdate(DbConfigManager configMgr)
     Process notifications of mutable property changes.
protected  intgetLockTableIndex(Long nodeId)
    
protected  intgetLockTableIndex(long nodeId)
    
abstract  LockergetWriteOwnerLocker(Long nodeId)
    
protected  LockergetWriteOwnerLockerInternal(Long nodeId, int lockTableIndex)
     Do the real work of getWriteOwnerLocker.
abstract  booleanisLocked(Long nodeId)
     Test the status of the lock on nodeId.
protected  booleanisLockedInternal(Long nodeId, int lockTableIndex)
     Do the real work of isLocked.
abstract  booleanisOwner(Long nodeId, Locker locker, LockType type)
     Return true if this locker owns this a lock of this type on given node.
protected  booleanisOwnerInternal(Long nodeId, Locker locker, LockType type, int lockTableIndex)
     Do the real work of isOwner.
abstract  booleanisWaiter(Long nodeId, Locker locker)
     Return true if this locker is waiting on this lock.
protected  booleanisWaiterInternal(Long nodeId, Locker locker, int lockTableIndex)
     Do the real work of isWaiter.
public  LockGrantTypelock(long nodeId, Locker locker, LockType type, long timeout, boolean nonBlockingRequest, DatabaseImpl database)
     Attempt to acquire a lock of type on nodeId.
public  LockStatslockStat(StatsConfig config)
    
abstract protected  LocklookupLock(Long nodeId)
    
protected  LocklookupLockInternal(Long nodeId, int lockTableIndex)
    
abstract protected  DeadlockExceptionmakeTimeoutMsg(String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, Lock useLock, long timeout, long start, long now, DatabaseImpl database)
     Create a informative lock or txn timeout message.
protected  DeadlockExceptionmakeTimeoutMsgInternal(String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, Lock useLock, long timeout, long start, long now, DatabaseImpl database)
     Do the real work of creating an lock or txn timeout message.
abstract  intnOwners(Long nodeId)
     Return the number of owners of this lock.
protected  intnOwnersInternal(Long nodeId, int lockTableIndex)
     Do the real work of nWaiters.
abstract  intnWaiters(Long nodeId)
     Return the number of waiters for this lock.
protected  intnWaitersInternal(Long nodeId, int lockTableIndex)
     Do the real work of nWaiters.
 booleanrelease(long nodeId, Locker locker)
     Release a lock and possibly notify any waiters that they have been granted the lock.
Parameters:
  nodeId - The node ID of the lock to release.
abstract protected  SetreleaseAndFindNotifyTargets(long nodeId, Locker locker)
     Release the lock, and return the set of new owners to notify, if any.
protected  SetreleaseAndFindNotifyTargetsInternal(long nodeId, Locker locker, int lockTableIndex)
    
static  voidsetLockTableDump(boolean enable)
     Called when the je.txn.dumpLocks property is changed.
abstract  voidtransfer(long nodeId, Locker owningLocker, Locker destLocker, boolean demoteToRead)
     Transfer ownership a lock from one locker to another locker.
protected  voidtransferInternal(long nodeId, Locker owningLocker, Locker destLocker, boolean demoteToRead, int lockTableIndex)
    
abstract  voidtransferMultiple(long nodeId, Locker owningLocker, Locker[] destLockers)
     Transfer ownership a lock from one locker to a set of other txns, cloning the lock as necessary.
protected  voidtransferMultipleInternal(long nodeId, Locker owningLocker, Locker[] destLockers, int lockTableIndex)
    
abstract protected  booleanvalidateOwnership(Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb)
    
protected  booleanvalidateOwnershipInternal(Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb, int lockTableIndex)
    

Field Detail
TOTAL_LOCK_OVERHEAD
final static long TOTAL_LOCK_OVERHEAD(Code)



lockTableLatches
protected Latch[] lockTableLatches(Code)



nLockTables
protected int nLockTables(Code)




Constructor Detail
LockManager
public LockManager(EnvironmentImpl envImpl) throws DatabaseException(Code)




Method Detail
attemptLock
abstract protected LockAttemptResult attemptLock(Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest) throws DatabaseException(Code)



attemptLockInternal
protected LockAttemptResult attemptLockInternal(Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest, int lockTableIndex) throws DatabaseException(Code)



demote
abstract void demote(long nodeId, Locker locker) throws DatabaseException(Code)
Demote a lock from write to read. Call back to the owning locker to move this to its read collection.
Parameters:
  lock - The lock to release. If null, use nodeId to find lock
Parameters:
  locker -



demoteInternal
protected void demoteInternal(long nodeId, Locker locker, int lockTableIndex) throws DatabaseException(Code)
Do the real work of demote.



dump
public void dump() throws DatabaseException(Code)
Debugging



dumpLockTable
abstract protected void dumpLockTable(LockStats stats) throws DatabaseException(Code)
Dump the lock table to the lock stats.



dumpLockTableInternal
protected void dumpLockTableInternal(LockStats stats, int i)(Code)
Do the real work of dumpLockTableInternal.



dumpToString
public String dumpToString() throws DatabaseException(Code)



envConfigUpdate
public void envConfigUpdate(DbConfigManager configMgr) throws DatabaseException(Code)
Process notifications of mutable property changes.



getLockTableIndex
protected int getLockTableIndex(Long nodeId)(Code)



getLockTableIndex
protected int getLockTableIndex(long nodeId)(Code)



getWriteOwnerLocker
abstract Locker getWriteOwnerLocker(Long nodeId) throws DatabaseException(Code)
the transaction that owns the write lock for this



getWriteOwnerLockerInternal
protected Locker getWriteOwnerLockerInternal(Long nodeId, int lockTableIndex) throws DatabaseException(Code)
Do the real work of getWriteOwnerLocker.



isLocked
abstract boolean isLocked(Long nodeId) throws DatabaseException(Code)
Test the status of the lock on nodeId. If any transaction holds any lock on it, true is returned. If no transaction holds a lock on it, false is returned. This method is only used by unit tests.
Parameters:
  nodeId - The NodeId to check. true if any transaction holds any lock on the nodeid. falseif no lock is held by any transaction.



isLockedInternal
protected boolean isLockedInternal(Long nodeId, int lockTableIndex)(Code)
Do the real work of isLocked.



isOwner
abstract boolean isOwner(Long nodeId, Locker locker, LockType type) throws DatabaseException(Code)
Return true if this locker owns this a lock of this type on given node. This method is only used by unit tests.



isOwnerInternal
protected boolean isOwnerInternal(Long nodeId, Locker locker, LockType type, int lockTableIndex)(Code)
Do the real work of isOwner.



isWaiter
abstract boolean isWaiter(Long nodeId, Locker locker) throws DatabaseException(Code)
Return true if this locker is waiting on this lock. This method is only used by unit tests.



isWaiterInternal
protected boolean isWaiterInternal(Long nodeId, Locker locker, int lockTableIndex)(Code)
Do the real work of isWaiter.



lock
public LockGrantType lock(long nodeId, Locker locker, LockType type, long timeout, boolean nonBlockingRequest, DatabaseImpl database) throws DeadlockException, DatabaseException(Code)
Attempt to acquire a lock of type on nodeId. If the lock acquisition would result in a deadlock, throw an exception.
If the requested lock is not currently available, block until it is or until timeout milliseconds have elapsed.
If a lock of type is already held, return EXISTING.
If a WRITE lock is held and a READ lock is requested, return PROMOTION.
If a lock request is for a lock that is not currently held, return either NEW or DENIED depending on whether the lock is granted or not.

Parameters:
  nodeId - The NodeId to lock.
Parameters:
  locker - The Locker to lock this on behalf of.
Parameters:
  type - The lock type requested.
Parameters:
  timeout - milliseconds to time out after if lock couldn't beobtained. 0 means block indefinitely. Not used if nonBlockingRequestis true.
Parameters:
  nonBlockingRequest - if true, means don't block if lock can't beacquired, and ignore the timeout parameter. a LockGrantType indicating whether the request was fulfilledor not. LockGrantType.NEW means the lock grant was fulfilled andthe caller did not previously hold the lock. PROMOTION means thelock was granted and it was a promotion from READ to WRITE. EXISTINGmeans the lock was already granted (not a promotion). DENIED meansthe lock was not granted either because the timeout passed withoutacquiring the lock or timeout was -1 and the lock was not immediatelyavailable.
throws:
  DeadlockException - if acquiring the lock would result ina deadlock.



lockStat
public LockStats lockStat(StatsConfig config) throws DatabaseException(Code)
Statistics



lookupLock
abstract protected Lock lookupLock(Long nodeId) throws DatabaseException(Code)



lookupLockInternal
protected Lock lookupLockInternal(Long nodeId, int lockTableIndex) throws DatabaseException(Code)



makeTimeoutMsg
abstract protected DeadlockException makeTimeoutMsg(String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, Lock useLock, long timeout, long start, long now, DatabaseImpl database) throws DatabaseException(Code)
Create a informative lock or txn timeout message.



makeTimeoutMsgInternal
protected DeadlockException makeTimeoutMsgInternal(String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, Lock useLock, long timeout, long start, long now, DatabaseImpl database)(Code)
Do the real work of creating an lock or txn timeout message.



nOwners
abstract int nOwners(Long nodeId) throws DatabaseException(Code)
Return the number of owners of this lock.



nOwnersInternal
protected int nOwnersInternal(Long nodeId, int lockTableIndex)(Code)
Do the real work of nWaiters.



nWaiters
abstract int nWaiters(Long nodeId) throws DatabaseException(Code)
Return the number of waiters for this lock.



nWaitersInternal
protected int nWaitersInternal(Long nodeId, int lockTableIndex)(Code)
Do the real work of nWaiters.



release
boolean release(long nodeId, Locker locker) throws DatabaseException(Code)
Release a lock and possibly notify any waiters that they have been granted the lock.
Parameters:
  nodeId - The node ID of the lock to release. true if the lock is released successfully, false ifthe lock is not currently being held.



releaseAndFindNotifyTargets
abstract protected Set releaseAndFindNotifyTargets(long nodeId, Locker locker) throws DatabaseException(Code)
Release the lock, and return the set of new owners to notify, if any. null if the lock does not exist or the given locker was not the owner,a non-empty set if owners should be notified after releasing,an empty set if no notification is required.



releaseAndFindNotifyTargetsInternal
protected Set releaseAndFindNotifyTargetsInternal(long nodeId, Locker locker, int lockTableIndex) throws DatabaseException(Code)
Do the real work of releaseAndFindNotifyTargets



setLockTableDump
static void setLockTableDump(boolean enable)(Code)
Called when the je.txn.dumpLocks property is changed.



transfer
abstract void transfer(long nodeId, Locker owningLocker, Locker destLocker, boolean demoteToRead) throws DatabaseException(Code)
Transfer ownership a lock from one locker to another locker. We're not sending any notification to the waiters on the lock table, and the past and present owner should be ready for the transfer.



transferInternal
protected void transferInternal(long nodeId, Locker owningLocker, Locker destLocker, boolean demoteToRead, int lockTableIndex) throws DatabaseException(Code)
Do the real work of transfer



transferMultiple
abstract void transferMultiple(long nodeId, Locker owningLocker, Locker[] destLockers) throws DatabaseException(Code)
Transfer ownership a lock from one locker to a set of other txns, cloning the lock as necessary. This will always be demoted to read, as we can't have multiple locker owners any other way. We're not sending any notification to the waiters on the lock table, and the past and present owners should be ready for the transfer.



transferMultipleInternal
protected void transferMultipleInternal(long nodeId, Locker owningLocker, Locker[] destLockers, int lockTableIndex) throws DatabaseException(Code)
Do the real work of transferMultiple



validateOwnership
abstract protected boolean validateOwnership(Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb) throws DatabaseException(Code)



validateOwnershipInternal
protected boolean validateOwnershipInternal(Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb, int lockTableIndex) throws DatabaseException(Code)



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.