Class ShExLockable
- java.lang.Object
-
- org.apache.derby.iapi.services.locks.ShExLockable
-
- All Implemented Interfaces:
Lockable
- Direct Known Subclasses:
CacheLock
,ClassLoaderLock
public class ShExLockable extends java.lang.Object implements Lockable
-
-
Constructor Summary
Constructors Constructor Description ShExLockable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
lockAttributes(int flag, java.util.Hashtable<java.lang.String,java.lang.Object> attributes)
This lockable want to participate in the Virtual LockTable when we want to print LATCH information.boolean
lockerAlwaysCompatible()
Returns true if any lock request on a Lockable L in a compatibility space CS1 is compatible with any other lock held on L in CS1.void
lockEvent(Latch lockInfo)
Note the fact the object is locked.boolean
requestCompatible(java.lang.Object requestedQualifier, java.lang.Object grantedQualifier)
Return true if the requested qualifier is compatible with the already granted qualifier.void
unlockEvent(Latch lockInfo)
Note that the object has been unlocked
-
-
-
Method Detail
-
lockerAlwaysCompatible
public boolean lockerAlwaysCompatible()
Description copied from interface:Lockable
Returns true if any lock request on a Lockable L in a compatibility space CS1 is compatible with any other lock held on L in CS1.- Specified by:
lockerAlwaysCompatible
in interfaceLockable
- See Also:
Lockable.lockerAlwaysCompatible()
-
requestCompatible
public boolean requestCompatible(java.lang.Object requestedQualifier, java.lang.Object grantedQualifier)
Description copied from interface:Lockable
Return true if the requested qualifier is compatible with the already granted qualifier.- Specified by:
requestCompatible
in interfaceLockable
- See Also:
Lockable.requestCompatible(java.lang.Object, java.lang.Object)
-
lockEvent
public void lockEvent(Latch lockInfo)
Description copied from interface:Lockable
Note the fact the object is locked. Performs required actions to ensure that unlockEvent() work correctly. This method does not actually perform any locking of the object, the locking mechanism is provided by the lock manager.If the class supports multiple lockers of the object then this method will be called once per locker, each with their own qualifier.
Must only be called by the lock manager. Synchronization will be handled by the lock manager.
- Specified by:
lockEvent
in interfaceLockable
- See Also:
Lockable.lockEvent(org.apache.derby.iapi.services.locks.Latch)
-
unlockEvent
public void unlockEvent(Latch lockInfo)
Description copied from interface:Lockable
Note that the object has been unlockedMust only be called by the lock manager. Synchronization will be handled by the lock manager.
- Specified by:
unlockEvent
in interfaceLockable
- See Also:
Lockable.unlockEvent(org.apache.derby.iapi.services.locks.Latch)
-
lockAttributes
public boolean lockAttributes(int flag, java.util.Hashtable<java.lang.String,java.lang.Object> attributes)
This lockable want to participate in the Virtual LockTable when we want to print LATCH information. Any lockable object which DOES NOT want to participate should override this function.- Specified by:
lockAttributes
in interfaceLockable
- Parameters:
flag
- use the bits in this int to decide if the user is interested in this kind of lockable object. The bits are defined in VirtualLockTable. For instance, the user may only ask for TABLE_AND_ROWLOCK and if this is not a table or row lock, then don't participate.attributes
- if this decides to participate, put all relevant attributes into the Hashtable. The complete list of interesting attributes is listed in VirtualLockTable. The following attributes must be present for all participating lockables: VirtualLockTable.LOCKNAME, VirtualLockTable.LOCKTYPE, either VirtualLockTable.CONTAINERID or VirtualLockTable.CONGLOMID,MT - this routine must be MP safe, caller will not be single threading the lock manager.
- Returns:
- true if this object has diagnostic information to add to the virtual lock table. If this object either does not want to participate in the diagnostic virtual lock table or none of the attributes requested are attributes of this lock, returns false.
- See Also:
VirtualLockTable
-
-