In addition to java API, the GEMOC Studio implements several web protocols.
For consistency, these protocols are defined using the same mechanism as LSP.
However, in order to be deployed internally in web browsers, instead of defining a socket or a port for each protocol, most implementation in the studio use websockets.
For convenience, an extensible websocket server is provided as an eclipse plugin (see Section 3.3, “Websocket server”). This allows deploying new endpoints in any eclipse based application or IDE, simply by adding a plugin extension.
Figure 60, “Protocols overview” shows an overview of the components that offer or use the protocols in the Eclipse Studio.
GEMOC provides a basic generator in order to consistently create protocol implementations using LSP like approach.
Note
The current generator primarily targets websocket endpoints, but the generated classes are probabl generic enough to be used in other context.
JSONSchema2APIProtocolGenerator
allows to generate several interfaces, implementations and documentation artifacts from a JSON schema representing the protocol
message specification.
The current version of JSONSchema2APIProtocolGenerator
is written in typescript.
Inputs :
It uses a file generator_config.json
to drive the generations and output directories.
generator_config.json
defines some parameters such as
- protocolJSONSchemaPath : path to the JSON schema representing the protocol messages
Currently supported output:
- plantuml : a graphical representation of the protocol
- tsAPI : a typescript implementation of the API (Work In Progress, please contribute )
- javaAPI : a java implementation of the API and the DTO (data transfert object), actually generated using xTend and using
org.eclipse.lsp4j.jsonrpc
library. - javaServer : a java interface of this protocol server
- javaClient : a java interface of this protocol client
The goal of the Engine Add-On Protocol (EAOP) is to provide services similar to those offered by the java IEngineAddon API (cf. Figure 56, “Execution Framework API Interfaces overview”) but via websocket communication.
The figure Figure 61, “Engine Add-On Protocol overview” presents the Client and Server JSON RPC methods and the exchanged data.
[82] asciidoc source of this page: https://github.com/eclipse/gemoc-studio/tree/master/docs/org.eclipse.gemoc.studio.doc/src/main/asciidoc/dev/Protocols_headContent.asciidoc.
[83] asciidoc source of this page: https://github.com/eclipse/gemoc-studio-modeldebugging/tree/master/protocols/generators/docs/ProtocolGenerators.asciidoc.