|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.evelopers.unimod.runtime.AbstractEventProcessor
Constructor Summary | |
AbstractEventProcessor()
|
Method Summary | |
void |
addEventProcessorListener(EventProcessorListener eventProcessorListener)
Adds eventProcessorListener to listeners list. |
void |
addExceptionHandler(ExceptionHandler handler)
Add handler for exceptions raised during event processing. |
protected boolean |
configExists(StateMachineConfig config)
|
protected void |
disposeConfig(StateMachinePath path,
StateMachineContext context,
StateMachineConfig config)
|
protected void |
fireAfterInputActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String transition,
java.lang.String inputActionName,
java.lang.Object value)
|
protected void |
fireAfterOnEnterActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String stateName,
java.lang.String outputAction)
|
protected void |
fireAfterOutputActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String transition,
java.lang.String outputAction)
|
protected void |
fireAfterSubmachineExecution(StateMachineContext context,
Event e,
StateMachinePath path,
java.lang.String state,
java.lang.String subMachine)
|
protected void |
fireBeforeInputActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String transition,
java.lang.String inputAction)
|
protected void |
fireBeforeOnEnterActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String stateName,
java.lang.String outputAction)
|
protected void |
fireBeforeOutputActionExecution(StateMachineContext context,
StateMachinePath path,
java.lang.String transition,
java.lang.String outputAction)
|
protected void |
fireBeforeSubmachineExecution(StateMachineContext context,
Event e,
StateMachinePath path,
java.lang.String state,
java.lang.String subMachine)
|
protected void |
fireComeToState(StateMachineContext context,
StateMachinePath path,
java.lang.String state)
|
protected void |
fireCompositeTargetState(StateMachineContext context,
StateMachinePath path,
java.lang.String state)
|
protected void |
fireEventProcessingFinished(StateMachineContext context,
Event e,
StateMachinePath path,
StateMachineConfig c)
|
protected void |
fireEventProcessingStarted(StateMachineContext context,
Event e,
StateMachinePath path,
StateMachineConfig c)
|
protected void |
fireEventSkipped(StateMachineContext context,
StateMachinePath path,
java.lang.String state,
Event event)
|
protected void |
fireException(StateMachineContext context,
com.evelopers.common.exception.SystemException e)
Sends notification about exception to exception handlers |
protected void |
fireStateMachineCameToFinalState(StateMachineContext context,
StateMachinePath path,
StateMachineConfig config)
|
protected void |
fireTransitionCandidate(StateMachineContext context,
StateMachinePath path,
java.lang.String state,
Event event,
java.lang.String transition)
|
protected void |
fireTransitionFound(StateMachineContext context,
StateMachinePath path,
java.lang.String state,
Event event,
java.lang.String transition)
|
protected void |
fireTransitionNotFound(StateMachineContext context,
StateMachinePath path,
java.lang.String state,
Event event)
|
protected void |
fireTransitionsOfSuperstate(StateMachineContext context,
StateMachinePath path,
java.lang.String superstate,
Event event)
|
protected ControlledObjectsMap |
getControlledObjectsMap()
Returns map of controlled objects. |
abstract ModelStructure |
getModelStructure()
Returns the structure of the model. |
protected StateMachineConfig |
initConfig(StateMachinePath path,
StateMachineContext context)
|
protected boolean |
isFinalConfig(StateMachinePath path,
StateMachineConfig config)
|
protected boolean |
isTopConfig(StateMachinePath path,
StateMachineConfig config)
|
protected StateMachineConfig |
loadConfig(StateMachinePath path,
StateMachineContext context)
|
void |
process(Event event,
StateMachineContext context)
Processes given event in the given context using root state machine instance. |
protected void |
process(Event event,
StateMachineContext context,
StateMachinePath path)
Processes given event using state machine instance defined by the given path. |
protected abstract StateMachineConfig |
process(Event event,
StateMachineContext context,
StateMachinePath path,
StateMachineConfig config)
Processes given event using state machine instance defined by the given config. |
void |
removeEventProcessorListener(EventProcessorListener eventProcessorListener)
Removess eventProcessorListener from listeners list. |
void |
removeExceptionHandler(ExceptionHandler handler)
Remove handler for exceptions raised during event processing. |
void |
setControlledObjectsMap(ControlledObjectsMap controlledObjectsMap)
Sets map of controlled objects. |
protected void |
storeConfig(StateMachinePath path,
StateMachineContext context,
StateMachineConfig config)
|
protected abstract StateMachineConfig |
transiteToStableState(StateMachineContext context,
StateMachinePath path,
StateMachineConfig config)
Transites from initial state config to stable
state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractEventProcessor()
Method Detail |
public final void process(Event event, StateMachineContext context)
ModelEngine
to notify event processor
about events.
process
in interface EventProcessor
event
- triggered event to processcontext
- state machine context of the eventprotected final void process(Event event, StateMachineContext context, StateMachinePath path)
event
- triggered event to processcontext
- state machine context of the eventpath
- path that defines the state machine instanceprotected final StateMachineConfig initConfig(StateMachinePath path, StateMachineContext context) throws EventProcessorException
EventProcessorException
protected final StateMachineConfig loadConfig(StateMachinePath path, StateMachineContext context) throws EventProcessorException
EventProcessorException
protected final void storeConfig(StateMachinePath path, StateMachineContext context, StateMachineConfig config) throws EventProcessorException
EventProcessorException
protected final void disposeConfig(StateMachinePath path, StateMachineContext context, StateMachineConfig config) throws EventProcessorException
EventProcessorException
protected final boolean configExists(StateMachineConfig config)
protected final boolean isTopConfig(StateMachinePath path, StateMachineConfig config) throws EventProcessorException
EventProcessorException
protected final boolean isFinalConfig(StateMachinePath path, StateMachineConfig config) throws EventProcessorException
EventProcessorException
protected abstract StateMachineConfig process(Event event, StateMachineContext context, StateMachinePath path, StateMachineConfig config) throws com.evelopers.common.exception.SystemException
switch
-operator.
Implementations of this method should fire event processing events
during execution.
event
- triggered event to processcontext
- state machine context of the eventpath
- path to state machine instanceconfig
- state machine config that defines the
state machine instance
com.evelopers.common.exception.SystemException
- if some input or output action throws
an exception. This exception will be handled by added ExceptionHandlersaddExceptionHandler(ExceptionHandler)
,
removeExceptionHandler(ExceptionHandler)
,
addEventProcessorListener(EventProcessorListener)
,
removeEventProcessorListener(EventProcessorListener)
protected abstract StateMachineConfig transiteToStableState(StateMachineContext context, StateMachinePath path, StateMachineConfig config) throws com.evelopers.common.exception.SystemException
config
to stable
state. This method should:
fireCompositeTargetState(com.evelopers.unimod.runtime.context.StateMachineContext, com.evelopers.unimod.runtime.StateMachinePath, java.lang.String)
fireComeToState(com.evelopers.unimod.runtime.context.StateMachineContext, com.evelopers.unimod.runtime.StateMachinePath, java.lang.String)
for new initial statetransiteToStableState(com.evelopers.unimod.runtime.context.StateMachineContext, com.evelopers.unimod.runtime.StateMachinePath, com.evelopers.unimod.runtime.StateMachineConfig)
with new initial state
context
- state machine context of the eventpath
- path that defines the state machine instanceconfig
- initial state to transite from
com.evelopers.common.exception.SystemException
public abstract ModelStructure getModelStructure()
getModelStructure
in interface EventProcessor
public void setControlledObjectsMap(ControlledObjectsMap controlledObjectsMap)
ModelEngine
from either
stand alone
and
build-in
factory methods.
setControlledObjectsMap
in interface EventProcessor
controlledObjectsMap
- map of controlled objectsprotected ControlledObjectsMap getControlledObjectsMap()
public void addExceptionHandler(ExceptionHandler handler)
addExceptionHandler
in interface EventProcessor
handler
- handler for exceptions raised during event processingpublic void removeExceptionHandler(ExceptionHandler handler)
removeExceptionHandler
in interface EventProcessor
handler
- handler for exceptions raised during event processingprotected void fireException(StateMachineContext context, com.evelopers.common.exception.SystemException e)
context
- of event that led to exceptione
- raised exceptionpublic void addEventProcessorListener(EventProcessorListener eventProcessorListener)
addEventProcessorListener
in interface EventProcessor
eventProcessorListener
- eventProcessorListener to addpublic void removeEventProcessorListener(EventProcessorListener eventProcessorListener)
removeEventProcessorListener
in interface EventProcessor
eventProcessorListener
- eventProcessorListener to removeprotected void fireEventProcessingStarted(StateMachineContext context, Event e, StateMachinePath path, StateMachineConfig c)
protected void fireEventProcessingFinished(StateMachineContext context, Event e, StateMachinePath path, StateMachineConfig c)
protected void fireStateMachineCameToFinalState(StateMachineContext context, StateMachinePath path, StateMachineConfig config)
protected void fireBeforeSubmachineExecution(StateMachineContext context, Event e, StateMachinePath path, java.lang.String state, java.lang.String subMachine)
protected void fireAfterSubmachineExecution(StateMachineContext context, Event e, StateMachinePath path, java.lang.String state, java.lang.String subMachine)
protected void fireBeforeOnEnterActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String stateName, java.lang.String outputAction)
protected void fireAfterOnEnterActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String stateName, java.lang.String outputAction)
protected void fireBeforeOutputActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String transition, java.lang.String outputAction)
protected void fireAfterOutputActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String transition, java.lang.String outputAction)
protected void fireBeforeInputActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String transition, java.lang.String inputAction)
protected void fireAfterInputActionExecution(StateMachineContext context, StateMachinePath path, java.lang.String transition, java.lang.String inputActionName, java.lang.Object value)
protected void fireTransitionCandidate(StateMachineContext context, StateMachinePath path, java.lang.String state, Event event, java.lang.String transition)
protected void fireTransitionsOfSuperstate(StateMachineContext context, StateMachinePath path, java.lang.String superstate, Event event)
protected void fireTransitionFound(StateMachineContext context, StateMachinePath path, java.lang.String state, Event event, java.lang.String transition)
protected void fireTransitionNotFound(StateMachineContext context, StateMachinePath path, java.lang.String state, Event event)
protected void fireEventSkipped(StateMachineContext context, StateMachinePath path, java.lang.String state, Event event)
protected void fireCompositeTargetState(StateMachineContext context, StateMachinePath path, java.lang.String state)
protected void fireComeToState(StateMachineContext context, StateMachinePath path, java.lang.String state)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |