Class 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 of EngineListener, and its descriptor ExecutionEngineDescriptor.
    • 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 element
        c - 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 element
        c - 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