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


java.lang.Object
   org.apache.derby.impl.services.locks.LockControl

LockControl
public class LockControl implements Control(Code)
A LockControl contains a reference to the item being locked and doubly linked lists for the granted locks and the waiting locks.

MT - Mutable - Container object : single thread required




Constructor Summary
protected  LockControl(Lock firstLock, Lockable ref)
    

Method Summary
public  LockaddLock(LockSet ls, Object compatabilitySpace, Object qualifier)
     Add a lock into this control, granted it if possible. This can be entered in several states.
  • The Lockable is locked (granted queue not empty), and there are no waiters (waiting queue is empty)
  • The Lockable is locked and there are waiters
  • The Lockable is locked and there are waiters and the first is potentially granted
  • The Lockable is unlocked and there are waiters and the first is potentially granted.
  • public  voidaddWaiters(Dictionary waiters)
         Add the waiters of this lock into this Dictionary object.
    public  ActiveLockfirstWaiter()
         Return the first lock in the wait line, null if the line is empty.
    public  LockgetFirstGrant()
        
    public  ListgetGranted()
        
     ListgetGrants()
         Return a Stack of the held locks (Lock objects) on this Lockable.
    final public  LockgetLock(Object compatabilitySpace, Object qualifier)
        
    public  LockControlgetLockControl()
        
    public  LockablegetLockable()
         Return the lockable object controlled by me.
     ActiveLockgetNextWaiter(ActiveLock item, boolean remove, LockSet ls)
         Get the next waiting lock (if any).
    public  ListgetWaiting()
        
    protected  voidgiveUpWait(Object item, LockSet ls)
        
     voidgrant(Lock lockItem)
         Grant this lock.
    public  booleanisEmpty()
        
    public  booleanisGrantable(boolean noWaitersBeforeMe, Object compatabilitySpace, Object qualifier)
         This routine can be called to see if a lock currently on the wait list could be granted.
    protected  booleanisUnlocked()
        
    public  ControlshallowClone()
        
    public  booleanunlock(Latch lockInGroup, int unlockCount)
        


    Constructor Detail
    LockControl
    protected LockControl(Lock firstLock, Lockable ref)(Code)




    Method Detail
    addLock
    public Lock addLock(LockSet ls, Object compatabilitySpace, Object qualifier)(Code)
    Add a lock into this control, granted it if possible. This can be entered in several states.
  • The Lockable is locked (granted queue not empty), and there are no waiters (waiting queue is empty)
  • The Lockable is locked and there are waiters
  • The Lockable is locked and there are waiters and the first is potentially granted
  • The Lockable is unlocked and there are waiters and the first is potentially granted. Logically the item is still locked, it's just that the lock has just been released and the first waker has not woken up yet. This call is never entered when the object is unlocked and there are no waiters. 1) The Lockable has just been unlocked,



  • addWaiters
    public void addWaiters(Dictionary waiters)(Code)
    Add the waiters of this lock into this Dictionary object.
    Each waiting thread gets two entries in the hashtable
    1. key=compatibility space - value=ActiveLock
    2. key=ActiveLock - value={LockControl for first waiter|ActiveLock of previosue waiter}



    firstWaiter
    public ActiveLock firstWaiter()(Code)
    Return the first lock in the wait line, null if the line is empty.



    getFirstGrant
    public Lock getFirstGrant()(Code)



    getGranted
    public List getGranted()(Code)



    getGrants
    List getGrants()(Code)
    Return a Stack of the held locks (Lock objects) on this Lockable.



    getLock
    final public Lock getLock(Object compatabilitySpace, Object qualifier)(Code)
    Find a granted lock matching this space and qualifier



    getLockControl
    public LockControl getLockControl()(Code)



    getLockable
    public Lockable getLockable()(Code)
    Return the lockable object controlled by me.



    getNextWaiter
    ActiveLock getNextWaiter(ActiveLock item, boolean remove, LockSet ls)(Code)
    Get the next waiting lock (if any).



    getWaiting
    public List getWaiting()(Code)



    giveUpWait
    protected void giveUpWait(Object item, LockSet ls)(Code)
    Give up waiting up on a lock



    grant
    void grant(Lock lockItem)(Code)
    Grant this lock.



    isEmpty
    public boolean isEmpty()(Code)



    isGrantable
    public boolean isGrantable(boolean noWaitersBeforeMe, Object compatabilitySpace, Object qualifier)(Code)
    This routine can be called to see if a lock currently on the wait list could be granted. If this lock has waiters ahead of it then we do not jump over the waiter(s) even if we can be granted. This avoids the first waiter being starved out.



    isUnlocked
    protected boolean isUnlocked()(Code)



    shallowClone
    public Control shallowClone()(Code)
    make a shallow clone of myself



    unlock
    public boolean unlock(Latch lockInGroup, int unlockCount)(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.