org.oddjob.state
Enum StateConditions

java.lang.Object
  extended by java.lang.Enum<StateConditions>
      extended by org.oddjob.state.StateConditions
All Implemented Interfaces:
Serializable, Comparable<StateConditions>, StateCondition

public enum StateConditions
extends Enum<StateConditions>
implements StateCondition

These are drop in replacements for jobs that used to use a JobStates for conditions.

Author:
Rob Gordon

Nested Class Summary
static class StateConditions.Conversions
          The Conversion from String
 
Enum Constant Summary
COMPLETE
          Is a job complete?
DESTROYED
          The job has been destroyed.
EXCEPTION
          Is a job in an exception state?
EXECUTING
          A state is either JobState.EXECUTING or ParentState.EXECUTING or ServiceState.STARTING.
FAILURE
          The state is either INCOMPLETE or EXCEPTION
FINISHED
          The state is either COMPLETE, INCOMPLETE or EXCEPTION
INCOMPLETE
          Is a job incomplete?
READY
          Is a job ready?
RUNNING
          Is a job executing or otherwise active?
STARTED
          A service has STARTED.
 
Method Summary
static StateConditions valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StateConditions[] 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
 
Methods inherited from interface org.oddjob.state.StateCondition
test
 

Enum Constant Detail

READY

public static final StateConditions READY
Is a job ready?


RUNNING

public static final StateConditions RUNNING
Is a job executing or otherwise active?


INCOMPLETE

public static final StateConditions INCOMPLETE
Is a job incomplete?


COMPLETE

public static final StateConditions COMPLETE
Is a job complete?


EXCEPTION

public static final StateConditions EXCEPTION
Is a job in an exception state?


DESTROYED

public static final StateConditions DESTROYED
The job has been destroyed. It can no longer be used. Note that many Jobs that use state conditions will enter an EXCEPTION state if the job they trigger on is destroyed, and so this state condition will not be met.


FAILURE

public static final StateConditions FAILURE
The state is either INCOMPLETE or EXCEPTION


FINISHED

public static final StateConditions FINISHED
The state is either COMPLETE, INCOMPLETE or EXCEPTION


EXECUTING

public static final StateConditions EXECUTING
A state is either JobState.EXECUTING or ParentState.EXECUTING or ServiceState.STARTING.


STARTED

public static final StateConditions STARTED
A service has STARTED.

Method Detail

values

public static StateConditions[] 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 (StateConditions c : StateConditions.values())
    System.out.println(c);

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

valueOf

public static StateConditions 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