org.apache.derby.impl.services.locks
Class LockSet
java.lang.Object
java.util.Dictionary
java.util.Hashtable
org.apache.derby.impl.services.locks.LockSet
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public final class LockSet
- extends java.util.Hashtable
A LockSet is a complete lock table. A lock table is a hash table
keyed by a Lockable and with a LockControl as the data element.
A LockControl contains information about the locks held on a Lockable.
MT - Mutable - Container Object : Thread Safe
The Hashtable we extend is synchronized on this, all addition, searching of
the hashtable is performed using java synchroization(this).
The class creates ActiveLock and LockControl objects.
LockControl objects are never passed out of this class, All the methods of
LockControl are called while being synchronized on this, thus providing the
single threading that LockControl required.
Methods of Lockables are only called by this class or LockControl, and
always while being synchronized on this, thus providing the single
threading that Lockable requires.
- See Also:
LockControl
,
Serialized Form
Nested classes inherited from class java.util.Hashtable |
|
Fields inherited from class java.util.Hashtable |
|
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
factory
private final SinglePool factory
deadlockTimeout
protected int deadlockTimeout
- Timeout for deadlocks, in ms.
MT - immutable
waitTimeout
protected int waitTimeout
deadlockTrace
private boolean deadlockTrace
lockTraces
private java.util.Hashtable lockTraces
blockCount
protected int blockCount
LockSet
protected LockSet(SinglePool factory)
lockObject
public Lock lockObject(java.lang.Object compatabilitySpace,
Lockable ref,
java.lang.Object qualifier,
int timeout,
Latch latch)
throws StandardException
- Lock an object within a specific compatibility space.
- Parameters:
compatabilitySpace
- Compatibility space.ref
- Lockable reference.qualifier
- Qualifier.timeout
- Timeout in milli-seconds
- Returns:
- Object that represents the lock.
- Throws:
StandardException
- Standard Cloudscape policy.
unlock
void unlock(Latch item,
int unlockCount)
- Unlock an object, previously locked by lockObject().
If unlockCOunt is not zero then the lock will be unlocked
that many times, otherwise the unlock count is taken from
item.
setDeadlockTrace
void setDeadlockTrace(boolean val)
toDebugString
public java.lang.String toDebugString()
shallowClone
LockSet shallowClone()
oneMoreWaiter
void oneMoreWaiter()
oneLessWaiter
void oneLessWaiter()
anyoneBlocked
boolean anyoneBlocked()
getControl
public final Control getControl(Lockable ref)
Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.