Skip to content

Commit 2c22d95

Browse files
committed
Merge branch 'master' into generic_trace_metamodel
2 parents 3767814 + af2d914 commit 2c22d95

File tree

27 files changed

+334
-177
lines changed

27 files changed

+334
-177
lines changed

dev/fr.obeo.dsl.dev/codestyle/GemocCheckstyle6Configuration-Light.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This configuration file was written by the eclipse-cs plugin configuration editor
66
-->
77
<!--
8-
Checkstyle-Configuration: ddd
8+
Checkstyle-Configuration: GEMOC IP
99
Description: none
1010
-->
1111
<module name="Checker">
@@ -17,6 +17,7 @@
1717
<property name="scope" value="public"/>
1818
<property name="allowMissingPropertyJavadoc" value="true"/>
1919
<property name="suppressLoadErrors" value="true"/>
20+
<property name="tokens" value="METHOD_DEF"/>
2021
</module>
2122
<module name="JavadocStyle">
2223
<property name="severity" value="warning"/>
@@ -40,12 +41,15 @@
4041
</module>
4142
<module name="LocalFinalVariableName">
4243
<property name="severity" value="warning"/>
44+
<property name="format" value="^[a-z_][a-zA-Z0-9]*$"/>
4345
</module>
4446
<module name="LocalVariableName">
4547
<property name="severity" value="warning"/>
4648
</module>
4749
<module name="MemberName">
4850
<property name="severity" value="warning"/>
51+
<property name="applyToProtected" value="false"/>
52+
<property name="applyToPrivate" value="false"/>
4953
</module>
5054
<module name="MethodName">
5155
<property name="severity" value="warning"/>
@@ -73,6 +77,7 @@
7377
</module>
7478
<module name="ImportOrder">
7579
<property name="severity" value="warning"/>
80+
<property name="groups" value="java, org, com"/>
7681
</module>
7782
<module name="RedundantImport">
7883
<property name="severity" value="error"/>
@@ -97,9 +102,10 @@
97102
<property name="max" value="3"/>
98103
</module>
99104
<module name="VisibilityModifier">
100-
<property name="severity" value="warning"/>
105+
<property name="severity" value="ignore"/>
101106
<property name="packageAllowed" value="true"/>
102107
<property name="protectedAllowed" value="true"/>
108+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="warning"/>
103109
</module>
104110
<module name="ArrayTypeStyle">
105111
<property name="severity" value="error"/>

framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence;
3535
import fr.inria.diverse.trace.commons.model.trace.Step;
3636

37+
38+
39+
/**
40+
* Common implementation of {@link IExecutionEngine}.
41+
* It provides the following services:
42+
* <ul>
43+
* <li>a basic implementation of the notification for the engine addons ({@link IEngineAddon}).</li>
44+
* <li>registration into the engine registry.</li>
45+
* <li>basic step service (with transaction)</li>
46+
* </ul>
47+
* This class is intended to be subclassed.
48+
* @author Didier Vojtisek<didier.vojtisek@inria.fr>
49+
*
50+
*/
3751
public abstract class AbstractExecutionEngine implements IExecutionEngine, IDisposable {
3852

3953
private RunStatus _runningStatus = RunStatus.Initializing;
@@ -385,6 +399,11 @@ private EMFCommandTransaction createTransaction(InternalTransactionalEditingDoma
385399
return new EMFCommandTransaction(command, editingDomain, null);
386400
}
387401

402+
403+
/* (non-Javadoc)
404+
* @see org.gemoc.xdsmlframework.api.core.IExecutionEngine#getCurrentMSEOccurrence()
405+
*/
406+
@Override
388407
public final MSEOccurrence getCurrentMSEOccurrence() {
389408
if (currentSteps.size() > 0)
390409
return currentSteps.getFirst().getMseoccurrence();

framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@
88
* Contributors:
99
* Inria - initial API and implementation
1010
*******************************************************************************/
11-
/* ******************************************************************************
12-
* C opyright (c) 2016 Inria and others.
13-
* All rights reserved. This program and the accompanying materials
14-
* are made available under the terms of the Eclipse Public License v1.0
15-
* which accompanies this distribution, and is available at
16-
* http://www.eclipse.org/legal/epl-v10.html
17-
*
18-
* Contributors:
19-
* Inria - initial API and implementation
20-
* ******************************************************************************/
2111
package org.gemoc.executionframework.engine.core;
2212

13+
2314
import java.io.IOException;
2415
import java.util.ArrayList;
2516
import java.util.Set;
@@ -47,18 +38,35 @@
4738
import fr.inria.diverse.trace.commons.model.trace.TraceFactory;
4839
import fr.inria.diverse.trace.gemoc.api.IMultiDimensionalTraceAddon;
4940

41+
42+
/**
43+
* Abstract class providing a basic implementation for sequential engines
44+
*
45+
* @author Didier Vojtisek<didier.vojtisek@inria.fr>
46+
*
47+
*/
5048
public abstract class AbstractSequentialExecutionEngine extends AbstractExecutionEngine implements IExecutionEngine {
5149

5250
private MSEModel _actionModel;
5351
private IMultiDimensionalTraceAddon<?,?,?,?,?> traceAddon;
5452

55-
abstract protected void executeEntryPoint();
53+
protected abstract void executeEntryPoint();
5654

57-
abstract protected void initializeModel();
55+
/**
56+
* if it exists, calls the method tagged as @Initialize
57+
*/
58+
protected abstract void initializeModel();
5859

59-
abstract protected void prepareEntryPoint(IExecutionContext executionContext);
60+
/**
61+
* search for an applicable entry point for the simulation, this is typically a method having the @Main annotation
62+
* @param executionContext the execution context of the simulation
63+
*/
64+
protected abstract void prepareEntryPoint(IExecutionContext executionContext);
6065

61-
abstract protected void prepareInitializeModel(IExecutionContext executionContext);
66+
/**
67+
* search for an applicable method tagged as @Initialize
68+
*/
69+
protected abstract void prepareInitializeModel(IExecutionContext executionContext);
6270

6371
@Override
6472
public final void performInitialize(IExecutionContext executionContext) {
@@ -181,6 +189,16 @@ private EOperation findOperation(EObject object, String className, String method
181189
return operation;
182190
}
183191

192+
193+
194+
/**
195+
* Find the MSE element for the triplet caller/className/MethodName in the model of precalculated possible MSE.
196+
* If it doesn't exist yet, create one and add it to the model.
197+
* @param caller the caller object
198+
* @param className the class containing the method
199+
* @param methodName the name of the method
200+
* @return the retrieved or created MSE
201+
*/
184202
public final MSE findOrCreateMSE(EObject caller, String className, String methodName) {
185203
EOperation operation = findOperation(caller, className, methodName);
186204
// TODO Should be created/loaded before execution by analyzing the

framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/EngineStoppedException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Exception thrown when the user stop the engine in plainK3 mode or if the engine is stopped normally
1616
* This allows to catch it and adapt the Engine response in this normal situation
17-
* @author dvojtise
17+
* @author Didier Vojtisek<didier.vojtisek@inria.fr>
1818
*
1919
*/
2020
public class EngineStoppedException extends RuntimeException {
@@ -23,6 +23,8 @@ public class EngineStoppedException extends RuntimeException {
2323
*/
2424
private static final long serialVersionUID = -8485492707115640348L;
2525

26+
27+
2628
public EngineStoppedException(String message) {
2729
super(message);
2830
}

framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/GemocRunningEnginesRegistry.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public class GemocRunningEnginesRegistry {
2626

2727

2828
/**
29-
* Add the given engine with this name, return the unique name really used for this engine
30-
* @param baseName
31-
* @param engine
32-
* @return
29+
* Add the given engine with this name
30+
* @param baseName (not used !? should be removed from API)
31+
* @param engine to add
32+
* @return the unique name really used for this engine
3333
*/
34-
synchronized public String registerEngine(String baseName, IExecutionEngine engine){
34+
public synchronized String registerEngine(String baseName, IExecutionEngine engine){
3535
int uniqueInstance = 0;
3636
String engineName = Thread.currentThread().getName() + " ("+uniqueInstance+")";
3737
synchronized(runningEngines)

framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/IEngineRegistrationListener.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@
1212

1313
import org.gemoc.xdsmlframework.api.core.IExecutionEngine;
1414

15+
/**
16+
* Listener interface used to be notified when engines are registered and unregistered from the Engine registry
17+
*
18+
* @author Didier Vojtisek<didier.vojtisek@inria.fr>
19+
*
20+
*/
1521
public interface IEngineRegistrationListener {
1622

23+
/**
24+
* method called by the registry when an engine is registered
25+
* @param engine the registered engine
26+
*/
1727
void engineRegistered(IExecutionEngine engine);
1828

29+
/**
30+
* method called by the registry when an engine is unregistered
31+
* @param engine the unregistered engine
32+
*/
1933
void engineUnregistered(IExecutionEngine engine);
2034

2135
}

framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,21 @@
2626
* given model, and to run the engine in different ways. It also allows the
2727
* caller to influence the constraints of the MoC at runtime.
2828
*
29-
* @author didier.vojtisek@inria.fr
29+
* @author Didier Vojtisek<didier.vojtisek@inria.fr>
3030
*
3131
*/
3232
public interface IExecutionEngine extends IDisposable {
3333

34+
/**
35+
* In case of nested calls, indicate the current stack of model specific event occurrences.
36+
* @return the current stack of {@link MSEOccurrence}
37+
*/
3438
Deque<MSEOccurrence> getCurrentStack();
3539

40+
/**
41+
* Provides the model specific event occurrence of the current step
42+
* @return the current MSEOccurrence
43+
*/
3644
MSEOccurrence getCurrentMSEOccurrence();
3745

3846
/**
@@ -45,46 +53,75 @@ public interface IExecutionEngine extends IDisposable {
4553
*/
4654
void stop();
4755

56+
/**
57+
* indicates the engine status {@link EngineStatus}
58+
* @return the engine status
59+
*/
4860
EngineStatus getEngineStatus();
4961

62+
/**
63+
* set the engine status {@link EngineStatus}
64+
* @param status the new status
65+
*/
5066
void setEngineStatus(RunStatus status);
5167

5268
/**
53-
*
54-
* @param type
69+
* Indicates if an {@link IEngineAddon} of the given type is linked to the engine
70+
* @param type of the searched addon
5571
* @return true if the engine has the addon, false otherwise.
5672
*/
5773
<T extends IEngineAddon> boolean hasAddon(Class<T> type);
5874

5975
/**
60-
*
61-
* @param type
62-
* @return The capability of the given type if it exists.
76+
* get the first {@link IEngineAddon} of the required type associated to this engine.
77+
* @param type searched type
78+
* @return The {@link IEngineAddon} of the given type if it exists.
6379
*/
6480
<T extends IEngineAddon> T getAddon(Class<T> type);
6581

82+
/**
83+
* get the execution context
84+
* @return the {@link IExecutionContext}
85+
*/
6686
IExecutionContext getExecutionContext();
6787

88+
/**
89+
* get the run status
90+
* @return the {@link RunStatus}
91+
*/
6892
RunStatus getRunningStatus();
6993

94+
/**
95+
* get all the {@link IEngineAddon} of the required type associated to this engine.
96+
* @param type searched type
97+
* @return a set of {@link IEngineAddon} of the given type.
98+
*/
7099
<T> Set<T> getAddonsTypedBy(Class<T> type);
71100

101+
/**
102+
* Ask the engine to initialize
103+
* @param executionContext the {@link IExecutionContext}
104+
*/
72105
void initialize(IExecutionContext executionContext);
73106

107+
/**
108+
* Create a {@link LaunchConfiguration} for the Trace based on the engine RunConfiguration.
109+
* @return a {@link fr.inria.diverse.trace.commons.model.trace.LaunchConfiguration}
110+
*/
74111
default LaunchConfiguration extractLaunchConfiguration() {
75112
return null;
76113
}
77114

78115
/**
79-
*
116+
* get the engine kind name
80117
* @return a user display name for the engine kind (will be used to compute
81118
* the full name of the engine instance)
82119
*/
83120
String engineKindName();
84121

85122
/**
86-
*
87-
* @return a displayable name to identify this engine
123+
* get the engine name
124+
* @return a display name to identify this engine
88125
*/
89126
String getName();
90127
}

framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/plugin.xml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@
44
<extension
55
point="org.eclipse.ui.newWizards">
66
<wizard
7-
category="org.gemoc.gemoc_language_workbench.ui"
7+
category="org.gemoc.xdsmlframework.category/org.gemoc.xdsmlframework.fragment.category"
88
class="org.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocDebugRepresentationWizard"
99
hasPages="true"
1010
icon="icons/IconeGemocLanguage-16.png"
1111
id="org.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocDebugRepresentationWizard"
12-
name="Create GEMOC debug representation">
13-
</wizard>
14-
<wizard
15-
category="org.gemoc.gemoc_language_workbench.ui"
16-
class="org.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocSiriusProjectWizard"
17-
hasPages="true"
18-
icon="icons/IconeGemocLanguage-16.png"
19-
id="org.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocSiriusProjectWizard"
20-
name="Create Sirius project">
12+
name="Debug/Animation Viewpoint Specification">
13+
<description>
14+
Create a debug/animation representation for a GEMOC language. May create a new project, or modify or extend an existing Viewpoint Specification.
15+
</description>
2116
</wizard>
2217
</extension>
2318
<extension

framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/src/main/java/org/gemoc/xdsmlframework/extensions/sirius/wizards/NewGemocDebugRepresentationWizard.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
public class NewGemocDebugRepresentationWizard extends Wizard implements
6464
IWorkbenchWizard {
6565

66-
private String initialProjectName;
67-
private String initialLanguageName;
66+
private String initialLanguageName = "myLanguage";
67+
private String initialProjectName = initialLanguageName;
6868

6969
private class FinishRunnable implements IRunnableWithProgress {
7070

0 commit comments

Comments
 (0)