public static class SessionLock.SessionTreePathLockCount extends java.lang.Object implements LockCountManager<SessionToken>
LockCountManager 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. | Constructor and Description |
|---|
SessionTreePathLockCount()
Creates a new
LockCountManager for session tokens, which
considers child sessions as equal to parent sessions but not vice versa. |
| Modifier and Type | Method and Description |
|---|---|
int |
decreaseAndGetLockCount(SessionToken session)
Decreases the number of times the designated object holds the lock.
|
java.lang.String |
getLockOwner()
Returns a string representation of one object that currently has a lock.
|
boolean |
hasLock(SessionToken session)
Returns whether the designated object has a lock at least once.
|
boolean |
hasLocks()
Returns whether this lock count manager knows at least one object that
has a lock.
|
int |
increaseAndGetLockCount(SessionToken session)
Increases the number of times the designated object holds the lock.
|
public SessionTreePathLockCount()
LockCountManager for session tokens, which
considers child sessions as equal to parent sessions but not vice versa.public boolean hasLock(SessionToken session)
LockCountManagerhasLock in interface LockCountManager<SessionToken>session - The object which is checked whether it holds a lock.public boolean hasLocks()
LockCountManagerhasLocks in interface LockCountManager<SessionToken>public java.lang.String getLockOwner()
LockCountManagergetLockOwner in interface LockCountManager<SessionToken>public int increaseAndGetLockCount(SessionToken session)
LockCountManagerincreaseAndGetLockCount in interface LockCountManager<SessionToken>session - The object which has acquired the lock (once again).public int decreaseAndGetLockCount(SessionToken session)
LockCountManagerdecreaseAndGetLockCount in interface LockCountManager<SessionToken>session - The object which has released the lock (once again).