Qwylt

java.lang.module.spi
Enum ModuleState.State

java.lang.Object
  extended by java.lang.Enum<ModuleState.State>
      extended by java.lang.module.spi.ModuleState.State
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ModuleState.State>
Enclosing class:
ModuleState

public static enum ModuleState.State
extends java.lang.Enum<ModuleState.State>

The state of this state machine. The following transitions are allowed:

     INITIALIZED -> PREPARING -> PREPARED -> COMMITTED -> SHARED -> CONNECTED
           \            \            \            \          \        \   \
            \            +------------+------------+----------+---> FAILED \
             \            \            \            \          \        \   \
              +------------+------------+------------+----------+-> UNINSTALLED
 
Instances may be constructed as INITIALIZED or COMMITTED, and will be driven to CONNECTED or FAILED.

New Module instances can be created only from CONNECTED state.


Enum Constant Summary
COMMITTED
          Specifies that this ModuleState is committed, and its imports have been selected.
CONNECTED
          Specifies that the import ImportSpace is fully connected and ready to serve its function as a ClassSpace.
FAILED
          Specifies that this state cannot be connected with the archives currently available to it.
INITIALIZED
          Specifies that this ModuleState has been created but not prepared.
PREPARED
          Specifies that the ImportSpace import mapping has been completed for this instance and all candidate connections, recursively.
PREPARING
          Specifies that the state is entering the prepare phase, during which time all imports are mapped into a ImportSpace with only candidate ModuleArchive connections.
SHARED
          Specifies that this ModuleState has committed its shared state, if any.
UNINSTALLED
          Specifies that this state can no longer be accessed.
 
Method Summary
 boolean isTerminal()
          Returns true if this state is terminal.
 ModuleState.State nextState()
          Returns the next state.
 boolean precedes(ModuleState.State targetState)
          Returns true if this state precedes the specified state.
static ModuleState.State valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ModuleState.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

INITIALIZED

public static final ModuleState.State INITIALIZED
Specifies that this ModuleState has been created but not prepared.


PREPARING

public static final ModuleState.State PREPARING
Specifies that the state is entering the prepare phase, during which time all imports are mapped into a ImportSpace with only candidate ModuleArchive connections. Each package scoped Import is mapped to a single connection, and each module scoped Import is mapped into multiple connections, one per package exported by the selected ModuleArchive.


PREPARED

public static final ModuleState.State PREPARED
Specifies that the ImportSpace import mapping has been completed for this instance and all candidate connections, recursively.


COMMITTED

public static final ModuleState.State COMMITTED
Specifies that this ModuleState is committed, and its imports have been selected.


SHARED

public static final ModuleState.State SHARED
Specifies that this ModuleState has committed its shared state, if any.


CONNECTED

public static final ModuleState.State CONNECTED
Specifies that the import ImportSpace is fully connected and ready to serve its function as a ClassSpace. This state is ready to produce new Module instances.


FAILED

public static final ModuleState.State FAILED
Specifies that this state cannot be connected with the archives currently available to it.


UNINSTALLED

public static final ModuleState.State UNINSTALLED
Specifies that this state can no longer be accessed.

Method Detail

values

public static ModuleState.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 (ModuleState.State c : ModuleState.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 ModuleState.State valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isTerminal

public boolean isTerminal()
Returns true if this state is terminal.

Returns:
true if this state is terminal, false otherwise.

nextState

public ModuleState.State nextState()
Returns the next state.

Returns:
The next state or null if state is terminal.

precedes

public boolean precedes(ModuleState.State targetState)
Returns true if this state precedes the specified state.

Parameters:
targetState - The state to compare against.
Returns:
true if this state precedes the target state, false otherwise.

Qwylt

Send comments or questions to Bryan Atsatt