Class KeepAliveLockProvider

java.lang.Object
net.javacrumbs.shedlock.support.KeepAliveLockProvider
All Implemented Interfaces:
LockProvider

public class KeepAliveLockProvider extends Object implements LockProvider
LockProvider that keeps the lock `alive`. In the middle of lockAtMostFor period tries to extend the lock for lockAtMostFor period. For example, if the lockAtMostFor is 10 minutes the lock is extended every 5 minutes for 10 minutes until the lock is released. If the process dies, the lock is automatically released after lockAtMostFor period as usual.

Does not support lockAtMostFor shorter than 30s. The reason is that with short (subsecond) lockAtMostFor time the time when we attmpt to extend the lock is too close to the expiration time and the lock can expire before we are able to extend it.

Wraps ExtensibleLockProvider that implements the actual locking.