View Javadoc

1   package com.atlassian.scheduler.config;
2   
3   import com.atlassian.annotations.PublicApi;
4   
5   /**
6    * Represents how a Job will be run by the scheduler.
7    * <p>
8    * This mostly defines how a job will run in a clustered environment; however, it also affects
9    * whether or not the job will survive a restart of the underlying application.
10   * </p>
11   */
12  @PublicApi
13  public enum RunMode {
14      /**
15       * The job is scheduled such that it will only run on one node of the cluster each time that it triggers.
16       * <p>
17       * Although jobs scheduled with this run mode must still register the {@code JobRunner} for the job on each restart,
18       * the job's schedule will persist across restarts.
19       * </p>
20       */
21      RUN_ONCE_PER_CLUSTER,
22  
23      /**
24       * The job is scheduled such that it will apply only to this particular node of the cluster.
25       * <p>
26       * This job will not be persisted, and the job must be recreated if the application is restarted.
27       * </p>
28       */
29      RUN_LOCALLY
30  }