Annotation Type SchedulerLock


@Target({METHOD,ANNOTATION_TYPE})
@Retention(RUNTIME)
public @interface SchedulerLock
  • Optional Element Summary

    Optional Elements
    Modifier and Type Optional Element Description
    String lockAtLeastFor
    The lock will be held at least for given duration.
    String lockAtMostFor
    How long the lock should be kept in case the machine which obtained the lock died before releasing it.
    String name
    Lock name.
  • Element Details

    • name

      String name
      Lock name.
      Default:
      ""
    • lockAtMostFor

      String lockAtMostFor
      How long the lock should be kept in case the machine which obtained the lock died before releasing it. This is just a fallback, under normal circumstances the lock is released as soon the tasks finishes. Can be either time with suffix like 10s or ISO8601 duration as described in Duration.parse(CharSequence), for example PT30S.
      Default:
      ""
    • lockAtLeastFor

      String lockAtLeastFor
      The lock will be held at least for given duration. 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 either time with suffix like 10s or ISO8601 duration as described in Duration.parse(CharSequence), for example PT30S.
      Default:
      ""