org.appdapter.api.module
Enum Module.State

java.lang.Object
  extended by java.lang.Enum<Module.State>
      extended by org.appdapter.api.module.Module.State
All Implemented Interfaces:
Serializable, Comparable<Module.State>
Enclosing interface:
Module<ParentModulator extends Modulator>

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


Enum Constant Summary
IN_INIT
          This state applies if and only if the initModule() method is currently executing.
IN_RUN
          This state applies if and only if the run() method is currently executing.
IN_START
          This state applies if and only if the start() method is currently executing.
IN_STOP
          This state applies if and only if the stop() method is currently executing.
POST_STOP_OR_FAILED_STARTUP
          Module is eligible to have releaseState() called, which is the only eligible method.
PRE_INIT
          This state applies if and only if no "action" methods of the Module interface have yet been called on this object.
WAIT_TO_RUN_OR_STOP
          Allowed xitions out = {IN_RUN or IN_STOP}
WAIT_TO_START
          First state the module must reliably return.
 
Method Summary
static Module.State valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Module.State[] 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

PRE_INIT

public static final Module.State PRE_INIT
This state applies if and only if no "action" methods of the Module interface have yet been called on this object. The module is not required to reliably return this state. But, convention would have us set this value in Module constructor. IN_INIT, POST_STOP_OR_FAILED_STARTUP


IN_INIT

public static final Module.State IN_INIT
This state applies if and only if the initModule() method is currently executing. Module is not required to reliably return this state. It may return null or PRE_INIT instead. Allowed xitions out = WAIT_TO_START


WAIT_TO_START

public static final Module.State WAIT_TO_START
First state the module must reliably return. Allowed xitions out = {IN_START or POST_STOP_OR_FAILED_STARTUP}


IN_START

public static final Module.State IN_START
This state applies if and only if the start() method is currently executing. Allowed xitions out = {WAIT_TO_RUN_OR_STOP or POST_STOP_OR_FAILED_STARTUP}


WAIT_TO_RUN_OR_STOP

public static final Module.State WAIT_TO_RUN_OR_STOP
Allowed xitions out = {IN_RUN or IN_STOP}


IN_RUN

public static final Module.State IN_RUN
This state applies if and only if the run() method is currently executing. Allowed xitions out = {WAIT_TO_RUN_OR_STOP} run() is not allowed to "fail" directly, must signal own stop RQ instead.


IN_STOP

public static final Module.State IN_STOP
This state applies if and only if the stop() method is currently executing. Allowed xitions out = {POST_STOP_OR_FAILED_STARTUP}


POST_STOP_OR_FAILED_STARTUP

public static final Module.State POST_STOP_OR_FAILED_STARTUP
Module is eligible to have releaseState() called, which is the only eligible method. The Module is required to reliably return this state value until the releaseState() method begins.

Method Detail

values

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

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

valueOf

public static Module.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
NullPointerException - if the argument is null


Copyright © 2010-2012. All Rights Reserved.