Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Publish Service



A publish Service is a service which handle the publication of datas from a provider to several subscribers. A publish Service:
  • Can only have one provider
  • Can have one or several subscribers

Overview

The following diagram shows the architecture of a publish Service:
  • During configuration, only one provider can be active, but one or several subscribers can be associated with the Service
  • During runtime, when the service is invoked by the provider, all the subscribers will be notified

publishservice
Note that is is possible to configure the framework to allow each publish service and request-response service to allow more than one Service provider at the same time. See framework properties.

Data management

The datas sent alongside the Service will always always have their last modified value. It means that if you want to modify values for the datas associated with the Service, you can do so for only those modified compared to the last invocation of the Service.

Declaring the Service

Declaring a publish Service is simple: you only have to define the Service name and ID (as for all Services), and the datas which are published by the Service. For example:
      <services>
         <publish name="position" id="1" >  
            <data name="latitude" type="float" />         
            <data name="longitude" type="float" />           
            <data name="altitude" type="float" />             
         </publish>                  
      </services>
See also services configuration.

Interfacing with the Service

Declaring how the Service is used for a module[1]
If the module is a provider or a subscriber of the Service
is specified in the module configuration for the Module. The declaration is to be performed under the interfaces element for the module configuration:
  • If the module is providing the service, declare a push element
  • If you want the module to provide the service cyclically without taking care of the sending thread yourself, declare a cyclic element, and specify the frequency on which it should be sent
  • If the module is subscribing to the service, declare a subscribe element
For example:
      <module name="theSender" >
         <interfaces>
            <push service="myPublish"/>
            <cyclic service="myCyclic" frequency="200ms"/>  
         </interfaces> 
      </module> 
      <module name="theReceiver" >
         <interfaces>
            <subscribe service="myPublish"/>
            <subscribe service="myCyclic"/>
         </interfaces> 
      </module>

Use cases

The publish Service use case is typically cases where you want to send datas to as many subscribers as necessary. A publish Service can be invoked as often as necessery (even cyclically).

For example, you can define a publish Service to publish an aircraft position (see the example below).

Aircraft position example

Consider the publication of an aircraft position. We would have the position service definition:
      <services>
         <publish name="position" id="1" >  
            <data name="latitude" type="float" />         
            <data name="longitude" type="float" />           
            <data name="altitude" type="float" />             
         </publish>                  
      </services>
And the InertialNavSystem, FlightManagementSystem, and GuidanceSystem modules definitions:
      <applications>
         <application name="aircraft" id="1">
            <modules>
               <module name="InertialNavSystem" id="1" > 
                  <interfaces>
                     <push service="position" attach="attach"/>
                  </interfaces>             
               </module>
               <module name="FlightManagementSystem" id="2" >          
                  <interfaces>
                     <subscribe service="position"/>
                  </interfaces>            
               </module> 
               <module name="GuidanceSystem" id="2" >          
                  <interfaces>
                     <subscribe service="position"/>
                  </interfaces>            
               </module>                            
            </modules>
         </application>          
      </applications>
The InertialNavSystem module provides the position Service. The FlightManagementSystem and GuidanceSystem modules are both notified of the published position.

publishsexample

Notes

  1. ^ If the module is a provider or a subscriber of the Service

See also


Categories: concepts

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence