Class ExecutionEngine
java.lang.Object
com.nomagic.magicdraw.simulation.engine.ExecutionEngine
The abstract class of the execution engine that all specific execution engines must extend,
and override abstract methods (init(), execute(), onClose). It maintains the list of
EngineListener
,
and its descriptor ExecutionEngineDescriptor
.-
Field Summary
Modifier and TypeFieldDescriptionprotected SimulationSession
a reference to the running session of this engine. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateElement
(Element element, Collection<?> c) Activate the element, it delegates to all storing engine listener.void
addEngineListener
(EngineListener listener) Add the specified engine listener to the storing engine listener list.void
deactivateElement
(Element element, Collection<?> c) Deactivate the element, it delegates to all storing engine listener.abstract void
Engine execution.Gets active elements.ExecutionEngineDescriptor getter.Get the engine listener list.Gets last visited element - element that was activated last and is already deactivatedabstract void
Engine initialization.abstract void
onClose()
Engine onClose.void
removeEngineListener
(EngineListener listener) Remove the specified engine listener from the storing engine listener list.void
triggerEvent
(String event) Trigger the specified event, it delegates to all storing engine listener.
-
Field Details
-
session
a reference to the running session of this engine.
-
-
Constructor Details
-
ExecutionEngine
Constructor.- Parameters:
engineDescriptor
- the given engine's descriptor.
-
-
Method Details
-
getEngineDescriptor
ExecutionEngineDescriptor getter.- Returns:
- ExecutionEngineDescriptor
-
init
Engine initialization.- Parameters:
element
- the given element
-
execute
Engine execution.- Parameters:
element
- the given element
-
onClose
@OpenApi public abstract void onClose()Engine onClose. -
addEngineListener
Add the specified engine listener to the storing engine listener list.- Parameters:
listener
- the specified engine listener
-
removeEngineListener
Remove the specified engine listener from the storing engine listener list.- Parameters:
listener
- the specified engine listener
-
getEngineListeners
Get the engine listener list.- Returns:
- the engine listener list.
-
activateElement
Activate the element, it delegates to all storing engine listener.- Parameters:
element
- the specified elementc
- the passing values
-
deactivateElement
Deactivate the element, it delegates to all storing engine listener.- Parameters:
element
- the specified elementc
- the passing values
-
triggerEvent
Trigger the specified event, it delegates to all storing engine listener.- Parameters:
event
- the specified event
-
getActiveElements
Gets active elements.- Returns:
- Active elements
-
getLastVisitedElement
Gets last visited element - element that was activated last and is already deactivated- Returns:
- Last visited element
-