public static class SessionLock.SubsessionLockCount extends java.lang.Object implements LockCountManager<SessionToken>
LockCountManager counting session tokens considering session
tokens and their subsessions (but not vice versa!) as equal. This means, a
child session will have a lock if a session of a parent level has the lock.
Parent sessions may "upgrade" (by acquisition) and
"downgrade" (by release) a lock. | Constructor and Description |
|---|
SubsessionLockCount()
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 SubsessionLockCount()
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).