This page documents the ongoing design for the interaction of Jolie's MetaService and Plasma::Services. The interaction is bidirectional, allowing for two basic actions: service access and service exposure. Moreover, MetaService supports the loading of services that are written in Jolie instead of Plasma::Services.
Communications between MetaService and Plasma::Service follow the SODEP protocol specifications. The SODEP protocol message format is designed specifically for service-oriented communications and treats the basic concepts of JOLIE messaging (resources and operations) as first-class citizens.
While it is not important to know the SODEP message encoding specifications, it is relevant to know what its basic concepts are in order to understand this document and the MetaService API documentation.
A SODEP message comprises three parts:
So we can represent a SODEP message as a triple: (Resource,Operation,Data). E.g., if we wanted to send a request for the "getNameById" operation of a service published under "/Registry", passing the value 5, we would use the following message: ("/Registry","getNameById",5).
Jolie resources are used to allow different services to share a single communication endpoint.
Suppose that you've published a Jolie service under the TCP port 8000. Now you want to publish other services under that port, so you need a means to disambiguate incoming messages on port 8000 because some messages will be for a service and some others for another service. Resources solve this problem.
A Jolie service can publish other services under its same communication endpoint by assigning them a resource name.
Say that we have three participants: A, R and B. R and B share the same communication endpoint for receiving input messages: R controls it and makes B accessible under resource "/Blah". Now A wants to send B a message, so it sends to R a message with resource name "/Blah". R will redirect the message to B and will take care of redirecting B's answer to A if necessary.
Operations are the basic block for a service interface. They stand to services as methods stand to objects.
For the sake of this document it's not necessary to know the SODEP data representation. It suffices to say that SODEP supports complex data structures (vectors, trees, etc.).
Service access allows Plasma to access an external service. The external service can be wrapped inside a Plasma::Service in order to offer plasmoids the same API they use for internal Plasma::Services.
Service access is composed by two main steps:
Now Plasma can send SODEP message to the resource pointed out by MetaService and these messages will be automatically redirected (and appropriately converted to the right protocol and transport mechanism) to the external service.
Service exposure allows Plasma to expose an internal Plasma::Service to external networks via MetaService.
When service exposure is triggered, Plasma::Service will: