rcf.core.concurrent.schedule
Enum Task.State

java.lang.Object
  extended by java.lang.Enum<Task.State>
      extended by rcf.core.concurrent.schedule.Task.State
All Implemented Interfaces:
Serializable, Comparable<Task.State>
Enclosing interface:
Task

public static enum Task.State
extends Enum<Task.State>

TODO: Javadoc TODO: State Transition Diagram TODO: Make the next state entries into hyperlinks

TODO: Unit tests, Code review, Javadoc review, Seal/Finalize TODO: equals, hashCode, toString

Version:
$Revision: 1.5 $
Author:
Greg Gibeling

Enum Constant Summary
Aborted
          TODO: Javadoc Aborted, like Committed and unlike Interrupted, means the task finished and the data structure invariants are established Unlike Committed, Aborted means that task did not affect these data structures.
Aborting
          TODO: Javadoc The task was asked to abort, but has not yet finished acting on this request.
Committed
          TODO: Javadoc Task has finished, and it's results have been fully written to the appropriate locations.
Committing
          TODO: Javadoc Task was finished, and a commit has been issued, but is not yet completed.
Constructed
          TODO: Javadoc The task has just been constructed.
Finished
          TODO: Javadoc The task has finished, but its results are being held in limbo.
Interrupted
          TODO: Javadoc Task was interrupted as some point during it's execution.
Interrupting
          TODO: Javadoc An interrupt has been taken, but has not yet been acted upon.
Runnable
          TODO: Javadoc The task is ready to be run.
Running
          TODO: Javadoc The task is currently running.
Scheduled
          TODO: Javadoc The task has been constructed, and scheduled, but is not ready to be run.
 
Field Summary
protected  SoftReference<rcf.core.util.filter.Filter<Task>> filter
          TODO: Javadoc A soft reference to filter for this state.
 boolean isActive
          TODO: Javadoc
 boolean isTerminal
          TODO: Javadoc
 Task.State terminal
          TODO: Javadoc
 
Method Summary
<X extends Task>
rcf.core.util.filter.Filter<X>
filter()
          TODO: Javadoc
static Task.State valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Task.State[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Constructed

public static final Task.State Constructed
TODO: Javadoc The task has just been constructed. NextState = Scheduled


Scheduled

public static final Task.State Scheduled
TODO: Javadoc The task has been constructed, and scheduled, but is not ready to be run. It could e.g. be waiting for a timer to fire. NextState = Runnable


Runnable

public static final Task.State Runnable
TODO: Javadoc The task is ready to be run. NextState = Running


Running

public static final Task.State Running
TODO: Javadoc The task is currently running. NextState = Finished


Finished

public static final Task.State Finished
TODO: Javadoc The task has finished, but its results are being held in limbo. NextState = {Interrupting, Committing, Aborting}


Interrupted

public static final Task.State Interrupted
TODO: Javadoc Task was interrupted as some point during it's execution. It may have affected various pieces of state, and it may not: it's effects are unknown. Not that an interrupted task may leave data structures and invariants in an unknown state. The is a terminal state.


Interrupting

public static final Task.State Interrupting
TODO: Javadoc An interrupt has been taken, but has not yet been acted upon. NextState = Interrupted


Committed

public static final Task.State Committed
TODO: Javadoc Task has finished, and it's results have been fully written to the appropriate locations. This state also implies that the appropriate data structure invariants have been set up again. The is a terminal state.


Committing

public static final Task.State Committing
TODO: Javadoc Task was finished, and a commit has been issued, but is not yet completed. This may be the case for e.g. a distributed transaction, or an operation which requires a write to a file. The transition to Committed should only take place when this tasks results are fully committed to their final location. NextState = Committed


Aborted

public static final Task.State Aborted
TODO: Javadoc Aborted, like Committed and unlike Interrupted, means the task finished and the data structure invariants are established Unlike Committed, Aborted means that task did not affect these data structures. The is a terminal state.


Aborting

public static final Task.State Aborting
TODO: Javadoc The task was asked to abort, but has not yet finished acting on this request. NextState = Aborted

Field Detail

isTerminal

public final boolean isTerminal
TODO: Javadoc


terminal

public final Task.State terminal
TODO: Javadoc


isActive

public final boolean isActive
TODO: Javadoc


filter

protected SoftReference<rcf.core.util.filter.Filter<Task>> filter
TODO: Javadoc A soft reference to filter for this state.

Method Detail

values

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

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

valueOf

public static Task.State 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

filter

public final <X extends Task> rcf.core.util.filter.Filter<X> filter()
TODO: Javadoc

Returns: