Class SessionLock.DownwardSubtreeLockCount
- java.lang.Object
- 
- de.aristaflow.adept2.base.sessionmanagement.SessionLock.AbstractLockCount
- 
- de.aristaflow.adept2.base.sessionmanagement.SessionLock.ChildSessionIDLockCount
- 
- de.aristaflow.adept2.base.sessionmanagement.SessionLock.DownwardSubtreeLockCount
 
 
 
- 
- All Implemented Interfaces:
- LockCountManager<SessionToken>
 - Enclosing class:
- SessionLock
 
 public static class SessionLock.DownwardSubtreeLockCount extends SessionLock.ChildSessionIDLockCount ALockCountManagerconsidering session tokens and their subsessions (but not vice versa!) as equal. This resemblesSessionLock.UpwardSubtreeLockCountbut differs in that additional locking sessions move a subtree downwards. This prevents sibling sessions from locking concurrently but only allows for consecutive sibling locking. Locking by parent sessions (ones lying on the way from a root to the top-level session) is allowed.
 The subtree will be locked until the last (child) session has unlocked.The root of a subtree will always be the locking session token with the highest child level. When locking a subtree will move downward if locked by a descendant session and it will move upward in case a current root unlocks. 
- 
- 
Constructor SummaryConstructors Constructor Description DownwardSubtreeLockCount()Creates a newLockCountManagerfor locking subtrees starting with a specific root which will move downward in case descendant sessions lock.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intdecreaseAndGetLockCount(SessionToken session)Decreases the number of times the designated object holds the lock.booleanhasLock(SessionToken session)Returns whether the designated object has a lock at least once.intincreaseAndGetLockCount(SessionToken session)Increases the number of times the designated object holds the lock.- 
Methods inherited from class de.aristaflow.adept2.base.sessionmanagement.SessionLock.AbstractLockCountgetLockOwner, hasLocks
 
- 
 
- 
- 
- 
Method Detail- 
hasLockpublic boolean hasLock(SessionToken session) Description copied from interface:LockCountManagerReturns whether the designated object has a lock at least once.- Specified by:
- hasLockin interface- LockCountManager<SessionToken>
- Overrides:
- hasLockin class- SessionLock.AbstractLockCount
- Parameters:
- session- The object which is checked whether it holds a lock.
- Returns:
- Whether the designated object has a lock at least once.
 
 - 
increaseAndGetLockCountpublic int increaseAndGetLockCount(SessionToken session) Description copied from interface:LockCountManagerIncreases the number of times the designated object holds the lock.- Specified by:
- increaseAndGetLockCountin interface- LockCountManager<SessionToken>
- Overrides:
- increaseAndGetLockCountin class- SessionLock.AbstractLockCount
- Parameters:
- session- The object which has acquired the lock (once again).
- Returns:
- The number of times the designated object has the lock after the increment.
 
 - 
decreaseAndGetLockCountpublic int decreaseAndGetLockCount(SessionToken session) Description copied from interface:LockCountManagerDecreases the number of times the designated object holds the lock. If the object does not hold the lock, the decrement will be ignored.- Specified by:
- decreaseAndGetLockCountin interface- LockCountManager<SessionToken>
- Overrides:
- decreaseAndGetLockCountin class- SessionLock.AbstractLockCount
- Parameters:
- session- The object which has released the lock (once again).
- Returns:
- The number of times the designated object has the lock after the decrement.
 
 
- 
 
-