private class InMemoryLockManager.TraceLockStatus extends InMemoryLockManager.LockStatus
LockStatus
used for trace-level debug
logging. In addition to the information tracked by the superclass, this
class maps stack trace information for the point of lock acquisition to
each lock holder. This information is used to debug lock contention
issues. It is only used when logging for the LockManager
is set to FINEST.Modifier and Type | Field and Description |
---|---|
private java.util.Map<SessionToken,java.lang.Throwable> |
traces
Map of locker tokens to Throwables containing stack data
|
Constructor and Description |
---|
TraceLockStatus(RecordIdentifier ident,
LockType lockType,
SessionToken locker)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addLocker(SessionToken locker)
Add a locking context to the set of contexts which currently hold
locks on the backing record.
|
protected void |
removeLocker(SessionToken locker)
Remove a locking context from the set of contexts which currently
hold locks on the backing record.
|
protected java.lang.String |
toStringVerbose()
Compose a string representation of this object for assistance in
debugging and testing.
|
getLockerCount, getLockInfo, getLockType, getRecordIdentifier, isLockedBy, isOnlyLocker, lockers, logContention, setLockType, toString
private final java.util.Map<SessionToken,java.lang.Throwable> traces
TraceLockStatus(RecordIdentifier ident, LockType lockType, SessionToken locker)
ident
- Unique identifier of record associated with this status
object.lockType
- Type of lock initially held on the record.locker
- the initial locking context.java.lang.NullPointerException
- if locker
is null
.protected java.lang.String toStringVerbose()
toStringVerbose
in class InMemoryLockManager.LockStatus
protected void removeLocker(SessionToken locker)
LockType.NONE
and notify any threads which are blocked on this object to resume
processing.removeLocker
in class InMemoryLockManager.LockStatus
locker
- Unique identifier of locking context to be removed.boolean addLocker(SessionToken locker)
addLocker
in class InMemoryLockManager.LockStatus
locker
- Unique identifier of locking context to be added.true
if locker
was added; false
if
locker
already was in the set of lockers.