|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.services.locks.Lock
class Lock
A Lock represents a granted or waiting lock request.
MT - Mutable - Immutable identity : Thread Aware
| Field Summary | |
|---|---|
(package private) int |
count
|
private java.lang.Object |
qualifier
Qualifier used in the lock request.. |
private Lockable |
ref
Object being locked. |
private CompatibilitySpace |
space
Compatibility space the object is locked in. |
| Constructor Summary | |
|---|---|
protected |
Lock(CompatibilitySpace space,
Lockable ref,
java.lang.Object qualifier)
|
| Method Summary | |
|---|---|
void |
addWaiters(java.util.Map waiters)
|
(package private) Lock |
copy()
|
boolean |
equals(java.lang.Object other)
|
ActiveLock |
firstWaiter()
|
CompatibilitySpace |
getCompatabilitySpace()
Return the compatibility space this lock is held in. |
int |
getCount()
Return the count of locks. |
Lock |
getFirstGrant()
|
java.util.List |
getGranted()
|
Lock |
getLock(CompatibilitySpace compatibilitySpace,
java.lang.Object qualifier)
|
Lockable |
getLockable()
Return the object this lock is held on MT - Thread safe |
LockControl |
getLockControl()
|
java.lang.Object |
getQualifier()
Return the qualifier lock was obtained with. |
java.util.List |
getWaiting()
|
(package private) void |
grant()
|
int |
hashCode()
|
boolean |
isEmpty()
|
boolean |
isGrantable(boolean noWaitersBeforeMe,
CompatibilitySpace compatibilitySpace,
java.lang.Object requestQualifier)
|
Control |
shallowClone()
We can return ourselves here because our identity is immutable and what we returned will not be accessed as a Lock, so the count cannot be changed. |
(package private) int |
unlock(int unlockCount)
|
boolean |
unlock(Latch lockInGroup,
int unlockCount)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final CompatibilitySpace space
private final Lockable ref
private final java.lang.Object qualifier
int count
| Constructor Detail |
|---|
protected Lock(CompatibilitySpace space,
Lockable ref,
java.lang.Object qualifier)
| Method Detail |
|---|
public final Lockable getLockable()
getLockable in interface LatchgetLockable in interface Controlpublic final CompatibilitySpace getCompatabilitySpace()
getCompatabilitySpace in interface Latchpublic final java.lang.Object getQualifier()
getQualifier in interface Latchpublic final int getCount()
getCount in interface Latchfinal Lock copy()
void grant()
int unlock(int unlockCount)
public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic LockControl getLockControl()
getLockControl in interface Control
public Lock getLock(CompatibilitySpace compatibilitySpace,
java.lang.Object qualifier)
getLock in interface Controlpublic Control shallowClone()
shallowClone in interface Controlpublic ActiveLock firstWaiter()
firstWaiter in interface Controlpublic boolean isEmpty()
isEmpty in interface Control
public boolean unlock(Latch lockInGroup,
int unlockCount)
unlock in interface Controlpublic void addWaiters(java.util.Map waiters)
addWaiters in interface Controlpublic Lock getFirstGrant()
getFirstGrant in interface Controlpublic java.util.List getGranted()
getGranted in interface Controlpublic java.util.List getWaiting()
getWaiting in interface Control
public boolean isGrantable(boolean noWaitersBeforeMe,
CompatibilitySpace compatibilitySpace,
java.lang.Object requestQualifier)
isGrantable in interface Control
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||