Class SessionLock.SessionTreePathLockCount
- java.lang.Object
-
- de.aristaflow.adept2.base.sessionmanagement.SessionLock.SessionTreePathLockCount
-
- All Implemented Interfaces:
LockCountManager<SessionToken>
- Enclosing class:
- SessionLock
@Deprecated public static class SessionLock.SessionTreePathLockCount extends Object implements LockCountManager<SessionToken>
Deprecated.This does not work as intended. UseSessionLock.DownwardSubtreeLockCount
instead.ALockCountManager
counting session tokens considering session tokens and their subsessions (but not vice versa!) as equal but prevents locking by siblings. This means, a child session is allowed to lock if a session of a parent level has the lock but no sibling has a lock. Parent sessions may acquire or release a lock while a child keeps the lock. However, ancestors that have not locked yet, may not lock, even if one of their descendants has the lock.
This locks a specific session token path in the session token tree and therefore disallows siblings to have the lock concurrently.- Author:
- Ulrich Kreher
-
-
Constructor Summary
Constructors Constructor Description SessionTreePathLockCount()
Deprecated.Creates a newLockCountManager
for session tokens, which considers child sessions as equal to parent sessions but not vice versa.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
decreaseAndGetLockCount(SessionToken session)
Deprecated.Decreases the number of times the designated object holds the lock.String
getLockOwner()
Deprecated.Returns a string representation of one object that currently has a lock.boolean
hasLock(SessionToken session)
Deprecated.Returns whether the designated object has a lock at least once.boolean
hasLocks()
Deprecated.Returns whether this lock count manager knows at least one object that has a lock.int
increaseAndGetLockCount(SessionToken session)
Deprecated.Increases the number of times the designated object holds the lock.
-
-
-
Method Detail
-
hasLock
public boolean hasLock(SessionToken session)
Deprecated.Description copied from interface:LockCountManager
Returns whether the designated object has a lock at least once.- Specified by:
hasLock
in interfaceLockCountManager<SessionToken>
- Parameters:
session
- The object which is checked whether it holds a lock.- Returns:
- Whether the designated object has a lock at least once.
-
hasLocks
public boolean hasLocks()
Deprecated.Description copied from interface:LockCountManager
Returns whether this lock count manager knows at least one object that has a lock.- Specified by:
hasLocks
in interfaceLockCountManager<SessionToken>
- Returns:
- Whether at least one object has a lock.
-
getLockOwner
public String getLockOwner()
Deprecated.Description copied from interface:LockCountManager
Returns a string representation of one object that currently has a lock. This can be used for user information or tracking purpose. A locking object may not be returned since this would allow to unlock.- Specified by:
getLockOwner
in interfaceLockCountManager<SessionToken>
- Returns:
- A string representation of one object that currently has a lock.
-
increaseAndGetLockCount
public int increaseAndGetLockCount(SessionToken session)
Deprecated.Description copied from interface:LockCountManager
Increases the number of times the designated object holds the lock.- Specified by:
increaseAndGetLockCount
in interfaceLockCountManager<SessionToken>
- 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.
-
decreaseAndGetLockCount
public int decreaseAndGetLockCount(SessionToken session)
Deprecated.Description copied from interface:LockCountManager
Decreases 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:
decreaseAndGetLockCount
in interfaceLockCountManager<SessionToken>
- 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.
-
-