| Modifier and Type | Required Element and Description |
|---|---|
String |
defaultLockAtMostFor
Default value how long the lock should be kept in case the machine which obtained the lock died before releasing it.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
defaultLockAtLeastFor
The lock will be held at least for this duration.
|
EnableSchedulerLock.InterceptMode |
mode |
public abstract String defaultLockAtMostFor
Duration.parse(CharSequence), for example PT30S.
This is just a fallback, under normal circumstances the lock is released as soon the tasks finishes.
Set this to some value much higher than normal task duration. Can be overridden in each ScheduledLock annotation.
Ignored when using ZooKeeper and other lock providers which are able to detect dead node.public abstract EnableSchedulerLock.InterceptMode mode
public abstract String defaultLockAtLeastFor
Duration.parse(CharSequence), for example PT30S. Can be used if you really need to execute the task
at most once in given period of time. If the duration of the task is shorter than clock difference between nodes, the task can
be theoretically executed more than once (one node after another). By setting this parameter, you can make sure that the
lock will be kept at least for given period of time. Can be overridden in each ScheduledLock annotation.Copyright © 2019. All rights reserved.