com.evelopers.unimod.runtime
Class ModelEngine

java.lang.Object
  extended bycom.evelopers.unimod.runtime.ModelEngine

public class ModelEngine
extends java.lang.Object

Entry point for state machine runtime engine.


Method Summary
static ModelEngine createBuildIn(EventManager eventManager, EventProcessor eventProcessor)
           
static ModelEngine createBuildIn(EventManager eventManager, EventProcessor eventProcessor, ControlledObjectsMap controlledObjectsMap)
          After creating new build-in engine you have to start your event providers manually.
static ModelEngine createStandAlone(EventManager eventManager, EventProcessor eventProcessor, ControlledObjectsManager coManager, EventProvidersManager epManager)
          After creating new stand alone engine you have to start() it
 ControlledObjectsManager getControlledObjectsManager()
           
 EventManager getEventManager()
           
 EventProcessor getEventProcessor()
          Returns event processor passed to factory method.
 EventProvidersManager getEventProvidersManager()
           
(package private)  void process(Event event, StateMachineContext context)
          Delegates call to AbstractEventProcessor.process(com.evelopers.unimod.core.stateworks.Event, com.evelopers.unimod.runtime.context.StateMachineContext).
 void start()
          For stand alone model inits all event providers, so they starts providing event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createStandAlone

public static ModelEngine createStandAlone(EventManager eventManager,
                                           EventProcessor eventProcessor,
                                           ControlledObjectsManager coManager,
                                           EventProvidersManager epManager)
                                    throws com.evelopers.common.exception.CommonException
After creating new stand alone engine you have to start() it

Parameters:
eventManager -
eventProcessor -
coManager -
epManager -
Returns:
Throws:
com.evelopers.common.exception.CommonException

start

public void start()
           throws com.evelopers.common.exception.CommonException
For stand alone model inits all event providers, so they starts providing event. For build-in do nothing

Throws:
com.evelopers.common.exception.CommonException

createBuildIn

public static ModelEngine createBuildIn(EventManager eventManager,
                                        EventProcessor eventProcessor,
                                        ControlledObjectsMap controlledObjectsMap)
                                 throws com.evelopers.common.exception.CommonException
After creating new build-in engine you have to start your event providers manually. Doesn't try to call start() - it's actual for stand alone engine only.

Parameters:
eventManager -
eventProcessor -
controlledObjectsMap -
Returns:
Throws:
com.evelopers.common.exception.CommonException

createBuildIn

public static ModelEngine createBuildIn(EventManager eventManager,
                                        EventProcessor eventProcessor)
                                 throws com.evelopers.common.exception.CommonException
Throws:
com.evelopers.common.exception.CommonException

process

void process(Event event,
             StateMachineContext context)
Delegates call to AbstractEventProcessor.process(com.evelopers.unimod.core.stateworks.Event, com.evelopers.unimod.runtime.context.StateMachineContext).

This method should be used ONLY by event manager.

Parameters:
event - event to process
context - current state machine context

getEventManager

public EventManager getEventManager()

getEventProcessor

public EventProcessor getEventProcessor()
Returns event processor passed to factory method.

Returns:
event processor passed to factory method

getEventProvidersManager

public EventProvidersManager getEventProvidersManager()
Returns:
Returns the eventProvidersManager.

getControlledObjectsManager

public ControlledObjectsManager getControlledObjectsManager()
Returns:
Returns the controlledObjectsManager.