diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractExecutionEngine.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractExecutionEngine.java index 98e2b6345..af21b5b3a 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractExecutionEngine.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractExecutionEngine.java @@ -313,42 +313,47 @@ public final void start() { @Override public void run() { - try { - notifyEngineAboutToStart(); - Activator.getDefault().gemocRunningEngineRegistry.registerEngine(getName(), AbstractExecutionEngine.this); - setEngineStatus(EngineStatus.RunStatus.Running); - beforeStart(); - notifyEngineStarted(); - try { - performStart(); - } finally { - // We always try to commit the last remaining - // transaction - commitCurrentTransaction(); - } - - } catch (EngineStoppedException stopException) { - // not really an error, simply print the stop exception - // message - Activator.getDefault().info("Engine stopped by the user : " + stopException.getMessage()); - - } catch (Throwable e) { - error = e; - e.printStackTrace(); - Activator.getDefault().error("Exception received " + e.getMessage() + ", stopping engine.", e); - } finally { - // make sure to notify the stop if this wasn't an - // external call to stop() that lead us here. - // ie. normal end of the mode execution - stop(); - Activator.getDefault().info("*** " + AbstractExecutionEngine.this.getName() + " stopped ***"); - } + startSynchronous(); } }; thread = new Thread(r, engineKindName() + " " + _executionContext.getRunConfiguration().getExecutedModelURI()); thread.start(); } } + + @Override + public final void startSynchronous() { + try { + notifyEngineAboutToStart(); + Activator.getDefault().gemocRunningEngineRegistry.registerEngine(getName(), AbstractExecutionEngine.this); + setEngineStatus(EngineStatus.RunStatus.Running); + beforeStart(); + notifyEngineStarted(); + try { + performStart(); + } finally { + // We always try to commit the last remaining + // transaction + commitCurrentTransaction(); + } + + } catch (EngineStoppedException stopException) { + // not really an error, simply print the stop exception + // message + Activator.getDefault().info("Engine stopped by the user : " + stopException.getMessage()); + + } catch (Throwable e) { + error = e; + e.printStackTrace(); + Activator.getDefault().error("Exception received " + e.getMessage() + ", stopping engine.", e); + } finally { + // make sure to notify the stop if this wasn't an + // external call to stop() that lead us here. + // ie. normal end of the mode execution + stop(); + Activator.getDefault().info("*** " + AbstractExecutionEngine.this.getName() + " stopped ***"); + } + } @Override public final void stop() { diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/core/IExecutionEngine.java b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/core/IExecutionEngine.java index c2fa3a8db..ccc2ee637 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/core/IExecutionEngine.java +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/core/IExecutionEngine.java @@ -124,4 +124,6 @@ default LaunchConfiguration extractLaunchConfiguration() { * @return a display name to identify this engine */ String getName(); + + void startSynchronous(); }