Skip to content

Commit e814a53

Browse files
committed
Better separation between Headless engine and MEP
1 parent 6dd7cfc commit e814a53

File tree

4 files changed

+116
-31
lines changed

4 files changed

+116
-31
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
package org.eclipse.gemoc.executionframework.engine.commons.sequential;
2+
3+
import java.util.Collection;
4+
5+
import org.eclipse.emf.common.util.URI;
6+
import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtension;
7+
8+
public class HeadlessJavaEngineSequentialRunConfiguration implements ISequentialRunConfiguration {
9+
10+
URI modelURI;
11+
String languageName;
12+
String modelEntryPoint;
13+
String methodEntryPoint;
14+
String initializationMethod;
15+
String initializationMethodArgs;
16+
public HeadlessJavaEngineSequentialRunConfiguration(URI modelURI, String languageName, String modelEntryPoint,
17+
String methodEntryPoint, String initializationMethod, String initializationMethodArgs) {
18+
this.modelURI = modelURI;
19+
this.languageName = languageName;
20+
this.modelEntryPoint = modelEntryPoint;
21+
this.methodEntryPoint = methodEntryPoint;
22+
this.initializationMethod = initializationMethod;
23+
this.initializationMethodArgs = initializationMethodArgs;
24+
}
25+
26+
@Override
27+
public int getAnimationDelay() {
28+
return 0;
29+
}
30+
31+
@Override
32+
public URI getAnimatorURI() {
33+
return null;
34+
}
35+
36+
@Override
37+
public boolean getBreakStart() {
38+
return false;
39+
}
40+
41+
@Override
42+
public String getDebugModelID() {
43+
// TODO Auto-generated method stub
44+
return null;
45+
}
46+
47+
@Override
48+
public Collection<EngineAddonSpecificationExtension> getEngineAddonExtensions() {
49+
return null;
50+
}
51+
52+
@Override
53+
public URI getExecutedModelAsMelangeURI() {
54+
// TODO Auto-generated method stub
55+
return null;
56+
}
57+
58+
@Override
59+
public URI getExecutedModelURI() {
60+
return modelURI;
61+
}
62+
63+
@Override
64+
public String getLanguageName() {
65+
return this.languageName;
66+
}
67+
68+
@Override
69+
public String getMelangeQuery() {
70+
// TODO Auto-generated method stub
71+
return null;
72+
}
73+
74+
@Override
75+
public String getExecutionEntryPoint() {
76+
return this.methodEntryPoint;
77+
}
78+
79+
@Override
80+
public String getModelEntryPoint() {
81+
return this.modelEntryPoint;
82+
}
83+
84+
@Override
85+
public String getModelInitializationMethod() {
86+
return this.initializationMethod;
87+
}
88+
89+
@Override
90+
public String getModelInitializationArguments() {
91+
return this.initializationMethodArgs;
92+
}
93+
94+
95+
public String getAttribute(String attributeName, String defaultValue) {
96+
// there is no addon in this mode, so return the default value
97+
return defaultValue;
98+
}
99+
100+
public Integer getAttribute(String attributeName, Integer defaultValue) {
101+
// there is no addon in this mode, so return the default value
102+
return defaultValue;
103+
}
104+
105+
public Boolean getAttribute(String attributeName, Boolean defaultValue) {
106+
// there is no addon in this mode, so return the default value
107+
return defaultValue;
108+
}
109+
110+
}

framework/execution_framework/pomfirst/org.eclipse.gemoc.executionframework.mep/pom.xml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@
4646
<artifactId>org.eclipse.emf.edit</artifactId>
4747
<version>2.16.0</version>
4848
</dependency>
49-
<dependency>
50-
<groupId>org.eclipse.gemoc.commons</groupId>
51-
<artifactId>org.eclipse.gemoc.commons.eclipse.pde</artifactId>
52-
<version>3.0.0-SNAPSHOT</version>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.eclipse.gemoc.commons</groupId>
56-
<artifactId>org.eclipse.gemoc.commons.eclipse.messagingsystem.api</artifactId>
57-
<version>3.0.0-SNAPSHOT</version>
58-
</dependency>
5949
<dependency>
6050
<groupId>org.eclipse.lsp4j</groupId>
6151
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
@@ -67,26 +57,6 @@
6757
<artifactId>org.eclipse.emf.edit</artifactId>
6858
<version>2.16.0</version>
6959
</dependency>
70-
<dependency>
71-
<groupId>org.eclipse.gemoc.commons</groupId>
72-
<artifactId>org.eclipse.gemoc.commons.eclipse.pde</artifactId>
73-
<version>3.0.0-SNAPSHOT</version>
74-
</dependency>
75-
<dependency>
76-
<groupId>org.eclipse.gemoc.commons</groupId>
77-
<artifactId>org.eclipse.gemoc.commons.eclipse.messagingsystem.api</artifactId>
78-
<version>3.0.0-SNAPSHOT</version>
79-
</dependency>
80-
<dependency>
81-
<groupId>org.eclipse.gemoc.pomfirst</groupId>
82-
<artifactId>org.eclipse.gemoc.xdsmlframework.api</artifactId>
83-
<version>4.0.0-SNAPSHOT</version>
84-
</dependency>
85-
<dependency>
86-
<groupId>org.eclipse.gemoc.pomfirst</groupId>
87-
<artifactId>org.eclipse.gemoc.xdsmlframework.commons</artifactId>
88-
<version>4.0.0-SNAPSHOT</version>
89-
</dependency>
9060

9161
</dependencies>
9262

framework/execution_framework/pomfirst/org.eclipse.gemoc.executionframework.mep/src/main/java/org/eclipse/gemoc/executionframework/mep/launch/GemocMEPServerImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ public void run() {
241241
LOG.error(e.getMessage(), e);
242242
}
243243
}
244-
244+
String languageName = "";
245+
if(args.containsKey(MEPLaunchParameterKey.language.name())) {
246+
languageName = (String) args.get(MEPLaunchParameterKey.language.name());
247+
}
245248
String methodEntryPoint = "";
246249
if(args.containsKey(MEPLaunchParameterKey.methodEntryPoint.name())) {
247250
methodEntryPoint = (String) args.get(MEPLaunchParameterKey.methodEntryPoint.name());
@@ -262,6 +265,7 @@ public void run() {
262265

263266
launcherParameters = new MEPLauncherParameters();
264267
launcherParameters.resourceModel = res;
268+
launcherParameters.languageName = languageName;
265269
launcherParameters.modelEntryPoint = modelEntryPoint;
266270
launcherParameters.methodEntryPoint = methodEntryPoint;
267271
launcherParameters.initializationMethod = initializationMethod;

framework/execution_framework/pomfirst/org.eclipse.gemoc.executionframework.mep/src/main/java/org/eclipse/gemoc/executionframework/mep/launch/MEPLauncherParameters.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
public class MEPLauncherParameters {
66

7+
public String languageName = "";
78
public Resource resourceModel = null;
89
public String modelEntryPoint = "";
910
public String methodEntryPoint = "";

0 commit comments

Comments
 (0)