|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILockSession
A lock session is the super container of lock sequences. If the session gets
released, the session makes sure that all connected lock sequences gets
released.
The burden to control the lock sequence behavior lies currently by the
session. Sequences could be used to separate between regional and local lock
areas (if the session supports such). For example:
//regional lock, locks needed by all following code parts
ILockSequence regionalLockSq = lockSession.beginLockSequence("regionalSequence");
// do regional locks
...code
// some local code
ILockSequence localLockSq = lockSession.beginLockSequence("localSequence");
//do local locks
...code
localLockSq.release(); //locks of the regional lock sq stay active
...
Method Summary | |
---|---|
ILockSequence |
beginLockSequence(String name)
Starts a new lock sequence, which is owned by the session. |
ILockSequence |
getCurrentLockSequence()
Returns the current active lock sequence of the session. |
LockSessionFactory |
getLockSessionFactory()
Returns the lock session factory over which the session was created. |
boolean |
isInvalid()
Returns true if the session is invalid, possibly because of an irreparable occured error like a DeadLockException . |
boolean |
isLocalLockHeldByASequence(Object lockKey)
Returns true, if for the given lockKey a local lock is held by one lock sequence. |
boolean |
isLockKeyOwnedByASequence(Object lockKey)
Returns true, if for the given lockKey a mutex is acquired by a lock sequence. |
boolean |
supportsNestedLockSequences()
Returns true, if the session supports nested sequences, false else. |
Methods inherited from interface net.sf.sasl.distributed.lock.ILockContainer |
---|
clear, getName, isActive, release |
Method Detail |
---|
ILockSequence beginLockSequence(String name) throws LockOperationException
name
- null or non null
LockOperationException
- in any exception case.ILockSequence getCurrentLockSequence() throws LockOperationException
LockOperationException
- in any exception case.boolean supportsNestedLockSequences()
boolean isLockKeyOwnedByASequence(Object lockKey)
lockKey
- non null
boolean isLocalLockHeldByASequence(Object lockKey)
lockKey
- non null.
boolean isInvalid()
DeadLockException
.
An invalid session can only be made valid again, by clearing it.
LockSessionFactory getLockSessionFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |