Package org.chenile.stm.impl
Class STMFlowStoreImpl
java.lang.Object
org.chenile.stm.impl.STMFlowStoreImpl
- All Implemented Interfaces:
TransientActionsAwareDescriptor
,STMFlowStore
- Direct Known Subclasses:
DummyStore
public class STMFlowStoreImpl
extends Object
implements STMFlowStore, TransientActionsAwareDescriptor
A base implementation of STMFlowStore FlowStoreReaders parse various
representations of the flow (such as in an xml or in a db) and call the
addflow() method in this class. Look at XmlFlowReader
for an example.
All of the functionality of FlowConfigurator interface is handled by this
class. The only part that is missing is the parsing part which is expected to
be provided by the parsing sub class. Besides flow configurations, other
things such as ScriptingStrategy
, entry actions, exit actions and
ComponentPropertiesHelper
are handled by this base class.
- Author:
- Raja Shankar Kolluru
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
StateTagDescriptor> private BeanFactoryAdapter
private ComponentPropertiesHelper
protected String
protected STMTransitionAction<?>
protected STMAction<?>
protected Map<String,
EventInformation> protected STMAction<?>
protected Map<String,
FlowDescriptor> private static final Logger
static final String
protected StateEntityRetrievalStrategy<? extends StateEntity>
private ScriptingStrategy
protected STMActionsInfoProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventInformation
(EventInformation eventInformation) void
This method is called during STD parsing.void
private State
correctState
(State state) StateEntityRetrievalStrategy<? extends StateEntity>
STMAction<?>
getEntryAction
(State state) getEventInformation
(String eventId) STMAction<?>
getExitAction
(State state) getFlowInfo
(String flowId) getInitialState
(State state) Obtains the correct state descriptor to start operations with given the current state.getSecurityStrategy
(String flowId) getStateInfo
(String flowId, String stateId) getStateInfo
(State state) getTransitionAction
(Transition transition) makeAction
(String componentName, boolean enableInlineScriptsInProperties) makeAutomaticStateComputation
(String componentName, boolean enableInlineScriptsInProperties) makeComponent
(String componentName) makeRetrievalStrategy
(String componentName) makeScriptingStrategy
(String componentName) makeSecurityStrategy
(String componentName) makeTransitionAction
(String componentName, boolean enableInlineScriptsInProperties) void
setBeanFactory
(BeanFactoryAdapter beanFactory) void
void
setDefaultTransitionAction
(String componentName) void
setEntryAction
(String componentName, boolean enableInlineScriptsInProperties) void
setEntryAction
(STMAction<?> entryAction) void
setExitAction
(String componentName, boolean enableInlineScriptsInProperties) void
setExitAction
(STMAction<?> exitAction) void
setScriptingStrategy
(String componentName) Called during parsing time when the scripting-strategy is defined in the configuration.void
setScriptingStrategy
(ScriptingStrategy scriptingStrategy) toString()
void
validate()
Make sure that the state machine is set up right.
-
Field Details
-
LOGGER
-
PATH_TO_DEFAULT_STM_CONFIGURATION
- See Also:
-
actionTagsMap
-
flows
-
eventInfos
-
stmActionsInfoProvider
-
entryAction
-
exitAction
-
defaultFlowId
-
beanFactory
-
retrievalStrategy
-
scriptingStrategy
-
componentPropertiesHelper
-
defaultTransitionAction
-
-
Constructor Details
-
STMFlowStoreImpl
public STMFlowStoreImpl()Always initialize the action tags first
-
-
Method Details
-
getStateInfo
-
getFlow
-
addStateTag
-
addFlow
This method is called during STD parsing. Every flow would result in a call to this so that the flow gets added to the configuration.- Parameters:
fd
- flowdescriptor
-
setDefaultFlow
-
makeComponent
- Throws:
STMException
-
makeTransitionAction
public Object makeTransitionAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
makeAction
public Object makeAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
makeAutomaticStateComputation
public Object makeAutomaticStateComputation(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
validate
Make sure that the state machine is set up right.- Throws:
Exception
-
getFlowInfo
-
getFlowInfo
-
setEntryAction
public void setEntryAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
setExitAction
public void setExitAction(String componentName, boolean enableInlineScriptsInProperties) throws STMException - Throws:
STMException
-
setDefaultTransitionAction
- Throws:
STMException
-
getDefaultFlowId
-
setScriptingStrategy
Called during parsing time when the scripting-strategy is defined in the configuration. In case of XML configuration, this method is called when the <scripting-strategy ...> xml element is encountered during parsing- Parameters:
componentName
-- Throws:
STMException
-
makeScriptingStrategy
- Throws:
STMException
-
makeSecurityStrategy
- Throws:
STMException
-
makeRetrievalStrategy
- Throws:
STMException
-
setScriptingStrategy
-
getEntryAction
- Specified by:
getEntryAction
in interfaceSTMFlowStore
- Returns:
- the entry action for the state.
-
getExitAction
- Specified by:
getExitAction
in interfaceSTMFlowStore
- Returns:
- the exit action for the state
-
getTransitionAction
- Specified by:
getTransitionAction
in interfaceSTMFlowStore
-
correctState
-
getStateInfo
- Specified by:
getStateInfo
in interfaceSTMFlowStore
- Returns:
- the state info.
-
getInitialState
Description copied from interface:STMFlowStore
Obtains the correct state descriptor to start operations with given the current state.- Specified by:
getInitialState
in interfaceSTMFlowStore
- Returns:
- the initial state for the particular flow if the flow was specified. initial state of the default flow if flow unspecified.
- Throws:
STMException
-
setEntryAction
- Specified by:
setEntryAction
in interfaceTransientActionsAwareDescriptor
-
setExitAction
- Specified by:
setExitAction
in interfaceTransientActionsAwareDescriptor
-
getBeanFactory
-
setBeanFactory
-
getDefaultRetrievalStrategy
- Specified by:
getDefaultRetrievalStrategy
in interfaceSTMFlowStore
- Returns:
-
getSecurityStrategy
- Specified by:
getSecurityStrategy
in interfaceSTMFlowStore
- Returns:
-
toString
-
addEventInformation
-
getEventInformation
- Specified by:
getEventInformation
in interfaceSTMFlowStore
-
getAllStates
- Specified by:
getAllStates
in interfaceSTMFlowStore
-
getDefaultFlow
- Specified by:
getDefaultFlow
in interfaceSTMFlowStore
-