com.evelopers.unimod.runtime
Interface StateMachineConfigManager

All Known Implementing Classes:
DistinguishConfigManager, SharedStateConfigManager, ThreadConfigManager

public interface StateMachineConfigManager

Manages life cycle of StateMachineConfig. Every state machine is associated with exactly one state machine config manager. So different instances of state machine in model (e.g. one submachine included in different states) are managed by one state machine config manager. To identify different instances of the same machine StateMachinePath is used.


Method Summary
 void dispose(StateMachinePath path, StateMachineContext context, StateMachineConfig finalConfig)
          Disposes config store.
 void init(StateMachinePath path, StateMachineContext context, StateMachineConfig initialConfig)
          Initializes config store.
 StateMachineConfig load(StateMachinePath path, StateMachineContext context)
          Loads config for given path from some store.
 void store(StateMachinePath path, StateMachineContext context, StateMachineConfig config)
          Stores given config against given path.
 

Method Detail

init

public void init(StateMachinePath path,
                 StateMachineContext context,
                 StateMachineConfig initialConfig)
Initializes config store.

Parameters:
path - path to state machine instance
initialConfig - initial config of the state machine

load

public StateMachineConfig load(StateMachinePath path,
                               StateMachineContext context)
Loads config for given path from some store. The type of store is defined by StateMachineConfigManager implementation.

If there is no stored config for given path then this method must return null. It will lead to init(com.evelopers.unimod.runtime.StateMachinePath, com.evelopers.unimod.runtime.context.StateMachineContext, com.evelopers.unimod.runtime.StateMachineConfig) method invocation.

Parameters:
path - path to state machine config to load
context - state machine context that has come with event
Returns:
loaded state machine config

store

public void store(StateMachinePath path,
                  StateMachineContext context,
                  StateMachineConfig config)
Stores given config against given path.

Parameters:
path - path to state machine config to store
context - state machine context that has come with event
config - state machine config to store

dispose

public void dispose(StateMachinePath path,
                    StateMachineContext context,
                    StateMachineConfig finalConfig)
Disposes config store.

AbstractEventProcessor will call this method when state machine comes to final state.

Parameters:
path - path to state machine instance
finalConfig - current final config of the state machine