Interface RenewableLockRegistry
- All Superinterfaces:
LockRegistry
- All Known Implementing Classes:
JdbcLockRegistry,RedisLockRegistry
A
LockRegistry implementing this interface supports the renewal
of the time to live of a lock.- Since:
- 5.4
- Author:
- Alexandre Strubel, Artem Bilan, Youbin Wu
-
Method Summary
Modifier and TypeMethodDescriptionvoidRenew the time to live of the lock is associated with the parameter object.default voidsetRenewalTaskScheduler(TaskScheduler renewalTaskScheduler) Set theTaskSchedulerto use for the renewal task.Methods inherited from interface org.springframework.integration.support.locks.LockRegistry
executeLocked, executeLocked, executeLocked, executeLocked, obtain
-
Method Details
-
renewLock
Renew the time to live of the lock is associated with the parameter object. The lock must be held by the current thread- Parameters:
lockKey- The object with which the lock is associated.
-
setRenewalTaskScheduler
Set theTaskSchedulerto use for the renewal task. When renewalTaskScheduler is set, it will be used to periodically renew the lock to ensure that the lock does not expire while the thread is working.- Parameters:
renewalTaskScheduler- renew task scheduler- Since:
- 6.4
-