com.evelopers.unimod.runtime.config
Class DistinguishConfigManager

java.lang.Object
  extended bycom.evelopers.unimod.runtime.config.DistinguishConfigManager
All Implemented Interfaces:
StateMachineConfigManager

public class DistinguishConfigManager
extends java.lang.Object
implements StateMachineConfigManager

In-memory config store implementation. Distinguishs configs for the same state machine if it's included in different states.


Constructor Summary
DistinguishConfigManager()
           
 
Method Summary
 void dispose(StateMachinePath path, StateMachineContext context, StateMachineConfig finalConfig)
          Disposes config store.
protected  StateMachineConfig getConfig(StateMachinePath path)
           
 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.
protected  void resetConfig(StateMachinePath path)
           
protected  void setConfig(StateMachinePath path, StateMachineConfig config)
           
 void store(StateMachinePath path, StateMachineContext context, StateMachineConfig config)
          Stores given config against given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistinguishConfigManager

public DistinguishConfigManager()
Method Detail

init

public void init(StateMachinePath path,
                 StateMachineContext context,
                 StateMachineConfig initialConfig)
Description copied from interface: StateMachineConfigManager
Initializes config store.

Specified by:
init in interface StateMachineConfigManager
Parameters:
path - path to state machine instance
initialConfig - initial config of the state machine

load

public StateMachineConfig load(StateMachinePath path,
                               StateMachineContext context)
Description copied from interface: StateMachineConfigManager
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 StateMachineConfigManager.init(com.evelopers.unimod.runtime.StateMachinePath, com.evelopers.unimod.runtime.context.StateMachineContext, com.evelopers.unimod.runtime.StateMachineConfig) method invocation.

Specified by:
load in interface StateMachineConfigManager
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)
Description copied from interface: StateMachineConfigManager
Stores given config against given path.

Specified by:
store in interface StateMachineConfigManager
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)
Description copied from interface: StateMachineConfigManager
Disposes config store.

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

Specified by:
dispose in interface StateMachineConfigManager
Parameters:
path - path to state machine instance
finalConfig - current final config of the state machine

getConfig

protected StateMachineConfig getConfig(StateMachinePath path)

setConfig

protected void setConfig(StateMachinePath path,
                         StateMachineConfig config)

resetConfig

protected void resetConfig(StateMachinePath path)