Package org.oddjob.state
Enum Class JobState
- All Implemented Interfaces:
Serializable,Comparable<JobState>,Constable,State
Encapsulate the allowed states for a job.
- Author:
- Rob Gordon
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn Asynchronous Job is waiting to complete.Indicates job has completed.The job has been destroyed.Indicates an exception has occurred.Indicates the job is executing.Indicates the job is not complete.Indicates the job is ready to be executing. -
Method Summary
Modifier and TypeMethodDescriptionstatic JobStateUtility function to convert a state text to to the JobState.static JobStateReturns the enum constant of this class with the specified name.static JobState[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.oddjob.state.State
isComplete, isDestroyed, isException, isExecuting, isIncomplete, isReady, isStoppable
-
Enum Constant Details
-
READY
Indicates the job is ready to be executing. The Oddjob Framework will only execute a job which is in this state. -
EXECUTING
Indicates the job is executing. -
ACTIVE
An Asynchronous Job is waiting to complete. -
INCOMPLETE
Indicates the job is not complete. Typically this is not unexpected, for instance a job which looks for a file, and a parent job will re-execute the job again at a later date. -
COMPLETE
Indicates job has completed. -
EXCEPTION
Indicates an exception has occurred. This is generally recoverable. Such as database failure, disk full etc. -
DESTROYED
The job has been destroyed. It can no longer be used.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
stateFor
Utility function to convert a state text to to the JobState.- Parameters:
state- Case insensitive text.- Returns:
- The corresponding jobState or null if it's invalid.
-