Package net.javacrumbs.shedlock.core
Class AbstractSimpleLock
java.lang.Object
net.javacrumbs.shedlock.core.AbstractSimpleLock
- All Implemented Interfaces:
SimpleLock
public abstract class AbstractSimpleLock extends Object implements SimpleLock
-
Field Summary
Fields Modifier and Type Field Description protected LockConfigurationlockConfiguration -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSimpleLock(LockConfiguration lockConfiguration) -
Method Summary
Modifier and Type Method Description protected Optional<SimpleLock>doExtend(LockConfiguration newConfiguration)protected abstract voiddoUnlock()Optional<SimpleLock>extend(Duration lockAtMostFor, Duration lockAtLeastFor)Extends the lock.Optional<SimpleLock>extend(Instant lockAtMostUntil, Instant lockAtLeastUntil)Deprecated.voidunlock()Unlocks the lock.
-
Field Details
-
lockConfiguration
-
-
Constructor Details
-
AbstractSimpleLock
-
-
Method Details
-
unlock
public final void unlock()Description copied from interface:SimpleLockUnlocks the lock. Once you unlock it, you should not use for any other operation.- Specified by:
unlockin interfaceSimpleLock
-
doUnlock
protected abstract void doUnlock() -
extend
@Deprecated public final Optional<SimpleLock> extend(Instant lockAtMostUntil, Instant lockAtLeastUntil)Deprecated.Description copied from interface:SimpleLockExtends the lock. If the lock can be extended a new lock is returned. After calling extend, no other operation can be called on current lock.This method is NOT supported by all lock providers.
- Specified by:
extendin interfaceSimpleLock- Returns:
- a new lock or empty optional if the lock can not be extended
-
extend
Description copied from interface:SimpleLockExtends the lock. If the lock can be extended a new lock is returned. After calling extend, no other operation can be called on current lock.This method is NOT supported by all lock providers.
- Specified by:
extendin interfaceSimpleLock- Returns:
- a new lock or empty optional if the lock can not be extended
-
doExtend
-