com.evelopers.unimod.debug
Class ThreadConfigManager

java.lang.Object
  extended bycom.evelopers.unimod.debug.ThreadConfigManager
All Implemented Interfaces:
StateMachineConfigManager

public class ThreadConfigManager
extends java.lang.Object
implements StateMachineConfigManager

Uses ThreadInfo as statemachine config key. If ThreadInfo can't be determined - does nothing


Constructor Summary
ThreadConfigManager()
           
 
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 onEnter(StateMachinePath path)
           
 void onExit(StateMachinePath path)
           
 void resetAllThreadConfigs()
           
 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

ThreadConfigManager

public ThreadConfigManager()
Method Detail

onEnter

public void onEnter(StateMachinePath path)

onExit

public void onExit(StateMachinePath path)

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

resetAllThreadConfigs

public void resetAllThreadConfigs()