Class ExecutionEngine
- java.lang.Object
-
- com.nomagic.magicdraw.simulation.engine.ExecutionEngine
-
@OpenApi public abstract class ExecutionEngine extends java.lang.Object
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 ofEngineListener
, and its descriptorExecutionEngineDescriptor
.
-
-
Field Summary
Fields Modifier and Type Field Description protected SimulationSession
session
a reference to the running session of this engine.
-
Constructor Summary
Constructors Constructor Description ExecutionEngine(ExecutionEngineDescriptor engineDescriptor)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activateElement(Element element, java.util.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, java.util.Collection<?> c)
Deactivate the element, it delegates to all storing engine listener.abstract void
execute(Element element)
Engine execution.java.util.List<Element>
getActiveElements()
Gets active elements.ExecutionEngineDescriptor
getEngineDescriptor()
ExecutionEngineDescriptor getter.java.util.List<EngineListener>
getEngineListeners()
Get the engine listener list.Element
getLastVisitedElement()
Gets last visited element - element that was activated last and is already deactivatedabstract void
init(Element element)
Engine initialization.abstract void
onClose()
Engine onClose.void
removeEngineListener(EngineListener listener)
Remove the specified engine listener from the storing engine listener list.void
triggerEvent(java.lang.String event)
Trigger the specified event, it delegates to all storing engine listener.
-
-
-
Field Detail
-
session
@OpenApi protected SimulationSession session
a reference to the running session of this engine.
-
-
Constructor Detail
-
ExecutionEngine
@OpenApi public ExecutionEngine(ExecutionEngineDescriptor engineDescriptor)
Constructor.- Parameters:
engineDescriptor
- the given engine's descriptor.
-
-
Method Detail
-
getEngineDescriptor
@OpenApi public ExecutionEngineDescriptor getEngineDescriptor()
ExecutionEngineDescriptor getter.- Returns:
- ExecutionEngineDescriptor
-
init
@OpenApi public abstract void init(Element element)
Engine initialization.- Parameters:
element
- the given element
-
execute
@OpenApi public abstract void execute(Element element)
Engine execution.- Parameters:
element
- the given element
-
onClose
@OpenApi public abstract void onClose()
Engine onClose.
-
addEngineListener
@OpenApi public void addEngineListener(EngineListener listener)
Add the specified engine listener to the storing engine listener list.- Parameters:
listener
- the specified engine listener
-
removeEngineListener
@OpenApi public void removeEngineListener(EngineListener listener)
Remove the specified engine listener from the storing engine listener list.- Parameters:
listener
- the specified engine listener
-
getEngineListeners
@OpenApi public java.util.List<EngineListener> getEngineListeners()
Get the engine listener list.- Returns:
- the engine listener list.
-
activateElement
@OpenApi public void activateElement(Element element, java.util.Collection<?> c)
Activate the element, it delegates to all storing engine listener.- Parameters:
element
- the specified elementc
- the passing values
-
deactivateElement
@OpenApi public void deactivateElement(Element element, java.util.Collection<?> c)
Deactivate the element, it delegates to all storing engine listener.- Parameters:
element
- the specified elementc
- the passing values
-
triggerEvent
@OpenApi public void triggerEvent(java.lang.String event)
Trigger the specified event, it delegates to all storing engine listener.- Parameters:
event
- the specified event
-
getActiveElements
@OpenApi public java.util.List<Element> getActiveElements()
Gets active elements.- Returns:
- Active elements
-
getLastVisitedElement
@OpenApi @CheckForNull public Element getLastVisitedElement()
Gets last visited element - element that was activated last and is already deactivated- Returns:
- Last visited element
-
-