com.atlassian.scheduler.config
Enum RunMode

java.lang.Object
  extended by java.lang.Enum<RunMode>
      extended by com.atlassian.scheduler.config.RunMode
All Implemented Interfaces:
Serializable, Comparable<RunMode>

@PublicApi
public enum RunMode
extends Enum<RunMode>

Represents how a Job will be run by the scheduler.

This mostly defines how a job will run in a clustered environment; however, it also affects whether or not the job will survive a restart of the underlying application.


Enum Constant Summary
RUN_LOCALLY
          The job is scheduled such that it will apply only to this particular node of the cluster.
RUN_ONCE_PER_CLUSTER
          The job is scheduled such that it will only run on one node of the cluster each time that it triggers.
 
Method Summary
static RunMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RunMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

RUN_ONCE_PER_CLUSTER

public static final RunMode RUN_ONCE_PER_CLUSTER
The job is scheduled such that it will only run on one node of the cluster each time that it triggers.

Although jobs scheduled with this run mode must still register the JobRunner for the job on each restart, the job's schedule will persist across restarts.


RUN_LOCALLY

public static final RunMode RUN_LOCALLY
The job is scheduled such that it will apply only to this particular node of the cluster.

This job will not be persisted, and the job must be recreated if the application is restarted.

Method Detail

values

public static RunMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RunMode c : RunMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RunMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2014 Atlassian. All Rights Reserved.