public interface PessimisticLock
Provides functionality to create, renew, remove and observe a records lock.
Locks will be stored in aPessimisticLockTable
which must be used to
lock records and has to be created before starting the locking process.PessimisticLockTable
Modifier and Type | Method and Description |
---|---|
void |
addLockTimeoutListener(LockTimeoutListener listener)
Observes for the locks timeout and notification threshold.
|
void |
addLockTimeoutPropertyChangeListener(LockTimeoutChangeListener listener)
Observes for a property change on the lock timeout property.
|
LockConstructionState |
getLock()
Notifies about the lock construction state either regenerated or
initially created.
|
PessimisticLockInfo |
getLockInfo()
Returns a property container which provides all relevant data about a
specific lock.
|
List<LockTimeoutChangeListener> |
getLockListener()
Returns all lock timeout property change observers.
|
Set<LockTimeoutListener> |
getLockTimeoutListener()
Returns all lock time out observers.
|
long |
getRemainingTime()
Returns the remaining lock duration.
|
long |
getTimeout()
Returns the initial lock duration.
|
boolean |
isUserValid()
Indicates whether this lock is still valid.
|
void |
removeLock()
Removes the lock from its related record.
|
void |
removeLockTimeoutListener(LockTimeoutListener listener)
Stops the observation of the locks timeout and notification threshold.
|
void |
removeLockTimeoutPropertyChangeListener(LockTimeoutChangeListener listener)
Stops observing the lock timeout property.
|
void |
renewLock(long timeout)
Regenerates an existing lock for a specific time.
|
LockConstructionState getLock() throws LockingException, RowAlreadyLockedException
LockConstructionState
.LockingException
- which provides exception information about failures within
the locking process.RowAlreadyLockedException
- which notifies about requesting a lock for a conflicted
record.void removeLock() throws LockingException
LockingException
- which provides exception information about failures within
the locking process.void renewLock(long timeout) throws LockingException, RowAlreadyLockedException
timeout
- the regeneration time.LockingException
- which provides exception information about failures within
the locking process.RowAlreadyLockedException
- which notifies about requesting a lock for a conflicted
record.PessimisticLockInfo getLockInfo()
boolean isUserValid() throws LockingException
LockingException
- which provides exception information about failures within
the locking process.long getTimeout()
long getRemainingTime() throws LockingException
LockingException
- which provides exception information about failures within
the locking process.void addLockTimeoutListener(LockTimeoutListener listener) throws LockingException
listener
- the lock duration observer.LockingException
- which provides exception information about failures within
the locking process.void removeLockTimeoutListener(LockTimeoutListener listener)
listener
- the lock duration observer to remove.Set<LockTimeoutListener> getLockTimeoutListener()
void addLockTimeoutPropertyChangeListener(LockTimeoutChangeListener listener)
listener
- the lock timeout property observer.void removeLockTimeoutPropertyChangeListener(LockTimeoutChangeListener listener)
listener
- the observer to remove.List<LockTimeoutChangeListener> getLockListener()
Copyright © 2003–2023 XDEV Software. All rights reserved.