You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: framework/framework_commons/docs/dev/FrameworkCommons.asciidoc
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,82 @@ endif::[]
15
15
footnote:[asciidoc source of this page: https://github.com/eclipse/gemoc-studio-modeldebugging/tree/master/execution_framework/xdsml_framework/docs/dev/FrameworkCommons.asciidoc.]
<1> Name of the class implementing JSR 356 `javax.websocket.server.ServerEndpoint`.
53
+
54
+
Class implementing the endpoint.
55
+
[source,java]
56
+
----
57
+
package org.example.endpoint;
58
+
59
+
import javax.websocket.OnMessage;
60
+
import javax.websocket.server.ServerEndpoint;
61
+
62
+
@ServerEndpoint("/test") <1>
63
+
public class TestEndPoint {
64
+
65
+
@OnMessage
66
+
public void handleOnMessage(String message) {
67
+
System.out.println("Message received by WebSocket : "+message); <2>
68
+
}
69
+
}
70
+
----
71
+
<1> path in the websocket server. If the alocated port is 96458, the endpoint is available at `ws://0.0.0.0:96458/test` (or `ws://localhost:96458/test` )
72
+
<2> behavior when receiving message on this endpoint.
73
+
74
+
75
+
On start, the server look for an available port (this is displayed on the console).
76
+
77
+
78
+
[TIP]
79
+
====
80
+
An example of plugin using the `org.eclipse.gemoc.ws.server` in GEMOC Studio (available in the IDE and headless application) is https://github.com/eclipse/gemoc-studio-modeldebugging/tree/master/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.addon.eaop.server[org.eclipse.gemoc.executionframework.addon.eaop.server].
81
+
====
82
+
83
+
84
+
[NOTE]
85
+
====
86
+
The websocket server is started only when the `org.eclipse.gemoc.ws.server` plugin starts,
87
+
you may either need to add it to the OSGI start or wait for another plugin to use it.
88
+
====
89
+
90
+
91
+
==== Framework Commons XDSLMFramework
92
+
93
+
18
94
<<img-FrameworkCommons-overview-CD-devguide>> shows some of the major interfaces of the execution framework API.
19
95
Most notably, the _IEngineAddon_ and _IExecutionEngine_ interfaces that are the entry points when implementing an Addon for GEMOC.
20
96
@@ -26,3 +102,5 @@ image::images/dev/frameworkcommons_api_overview_CD.png["Execution Framework API
26
102
27
103
TIP: The section <<dev-new-addons>> contains some details and code snippets about how to write an engine addon.
footnote:[asciidoc source of this page: https://github.com/eclipse/gemoc-studio-modeldebugging/tree/master/protocols/generators/docs/ProtocolGenerators.asciidoc.]
14
+
15
+
GEMOC provides a basic generator in order to consistently create protocol implementations using LSP like approach.
16
+
17
+
[NOTE]
18
+
====
19
+
The current generator primarily targets websocket endpoints, but the generated classes are probabl generic enough to be used in other context.
20
+
21
+
====
22
+
23
+
24
+
=== JSONSchema2APIProtocolGenerator
25
+
26
+
`JSONSchema2APIProtocolGenerator` allows to generate several interfaces, implementations and documentation artifacts from a JSON schema representing the protocol message specification.
27
+
28
+
The current version of `JSONSchema2APIProtocolGenerator` is written in typescript.
29
+
30
+
Inputs :
31
+
It uses a file `generator_config.json` to drive the generations and output directories.
32
+
`generator_config.json` defines some parameters such as
33
+
34
+
* *protocolJSONSchemaPath* : path to the JSON schema representing the protocol messages
35
+
36
+
37
+
Currently supported output:
38
+
39
+
* *plantuml* : a graphical representation of the protocol
40
+
* *tsAPI* : a typescript implementation of the API (Work In Progress, please contribute )
41
+
* *javaAPI* : a java implementation of the API and the DTO (data transfert object), actually generated using xTend and using `org.eclipse.lsp4j.jsonrpc` library.
42
+
* *javaServer* : a java interface of this protocol server
43
+
* *javaClient* : a java interface of this protocol client
0 commit comments