From ec940d7f3ecb2514297b15b817c5a897b094d2a6 Mon Sep 17 00:00:00 2001 From: Didier Vojtisek Date: Thu, 30 Jan 2020 15:45:35 +0100 Subject: [PATCH 1/2] updated class diagram about IEngineAddon interface contributes to https://github.com/eclipse/gemoc-studio-modeldebugging/issues/151 Signed-off-by: Didier Vojtisek --- .../frameworkcommons_api_overview_CD.plantuml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml b/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml index 672edfff3..cf1aba0ba 100644 --- a/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml +++ b/framework/framework_commons/docs/dev/images/dev/frameworkcommons_api_overview_CD.plantuml @@ -9,6 +9,7 @@ scale max 1024 width scale max 800 height package xdsmlframework.api.engine_addon { + interface IEngineAddon #beige { void engineAboutToStart(IExecutionEngine engine) void engineStarted(IExecutionEngine executionEngine) @@ -23,7 +24,40 @@ package xdsmlframework.api.engine_addon { void stepExecuted(IExecutionEngine engine, trace.commons.model.trace.Step stepExecuted) void engineStatusChanged(IExecutionEngine engine, EngineStatus.RunStatus newStatus) List validate(List otherAddons) + String getAddonID() + List getTags() + List getAddonSortingRules() } + + class EngineAddonSortingRule { + Priority priority + IEngineAddon owner; + EngineEvent event; + Priority priority; + List addonsWithTags; + } + enum Priority { + BEFORE + AFTER + } + enum EngineEvent { + engineAboutToStart + engineStarted, + engineInitialized + engineAboutToStop, + engineStopped + engineAboutToDispose + aboutToSelectStep + proposedStepsChanged + stepSelected + aboutToExecuteStep + stepExecuted + engineStatusChanged + } + + Priority -[hidden]> EngineAddonSortingRule + EngineEvent -[hidden]> EngineAddonSortingRule + IEngineAddon <-- EngineAddonSortingRule : owner } package xdsmlframework.api.core { From 89986300aa8e6ef43e37d11a7fa05e2c223743f0 Mon Sep 17 00:00:00 2001 From: Didier Vojtisek Date: Fri, 31 Jan 2020 11:43:09 +0100 Subject: [PATCH 2/2] updated documentation about IEngineAddon interface contributes to https://github.com/eclipse/gemoc-studio-modeldebugging/issues/151 Signed-off-by: Didier Vojtisek --- .../dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml | 5 +++++ .../framework_commons/docs/dev/FrameworkCommons.asciidoc | 2 ++ .../gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml b/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml index c85b5a7ef..0696ee81f 100644 --- a/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml +++ b/framework/execution_framework/docs/dev/images/dev/ExecutionEngine_Typical_flow_SD.plantuml @@ -35,6 +35,11 @@ deactivate Launcher deactivate Launcher Engine --> addon : engineAboutToStart +note right + if required, the order of the calls to the Addons + can be controled by defining + EngineAddonSortingRules in the Addons +end note Engine -> Engine : beforeStart Engine --> addon : engineStarted Engine -> Engine : performStart diff --git a/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc b/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc index 7cfe1c3c3..f665020c8 100644 --- a/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc +++ b/framework/framework_commons/docs/dev/FrameworkCommons.asciidoc @@ -24,3 +24,5 @@ Most notably, the _IEngineAddon_ and _IExecutionEngine_ interfaces that are the image::images/dev/frameworkcommons_api_overview_CD.png["Execution Framework API Interfaces overview"] +TIP: The section <> contains some details and code snippets about how to write an engine addon. + diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java index d8c6588d3..4c8b7f194 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java @@ -113,7 +113,7 @@ default public List getTags() { * A given rule indicate when to call the current addon relatively to addons referred by the rule * @return */ - default public List getAddonSortingRules(){ + default public List getAddonSortingRules() { return new ArrayList(); }