|
|||||||||
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 Latch
getLockable
in interface Control
public final CompatibilitySpace getCompatabilitySpace()
getCompatabilitySpace
in interface Latch
public final java.lang.Object getQualifier()
getQualifier
in interface Latch
public final int getCount()
getCount
in interface Latch
final Lock copy()
void grant()
int unlock(int unlockCount)
public final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public LockControl getLockControl()
getLockControl
in interface Control
public Lock getLock(CompatibilitySpace compatibilitySpace, java.lang.Object qualifier)
getLock
in interface Control
public Control shallowClone()
shallowClone
in interface Control
public ActiveLock firstWaiter()
firstWaiter
in interface Control
public boolean isEmpty()
isEmpty
in interface Control
public boolean unlock(Latch lockInGroup, int unlockCount)
unlock
in interface Control
public void addWaiters(java.util.Map waiters)
addWaiters
in interface Control
public Lock getFirstGrant()
getFirstGrant
in interface Control
public java.util.List getGranted()
getGranted
in interface Control
public 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 Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |