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

Service providers and subscribers



A module:
  • Provides Services
  • Subscribe to Services
Providers for one service are modules which are able to invoke this service. Subscribers for one service are modules which are able to be notified by this service. Services are processing units which are provided or required by modules[1]
See Service-oriented framework on Wikipedia
.

A Service has a contract and associated input and output datas[2]
It is perfectly valid for a Service to not have associated Datas at all. For example, it can be sufficient to be notified from the execution of an Event Service without the need to have any additional datas, such as a click on a Button for example
. Note that Services are not always unidirectional. For example a Request-Response Service can be invoked:
  • By a Service subscriber: to emit a request
  • By the Service provider: to return the response to a request

Service providers

A Service provider is a module which invokes the Service. The result of the Service invocation is notified to its subscribers.

Some services may only have one active provider, whereas other services can have several providers. For example:
  • A publish Service is designed to send datas to its subscribers (even cyclically), so only provider can be active
  • An event Service is designed to send events to its subscribers, so more than one provider can be active

Attaching the Service


To be able to invoke a Service, a module must be declared as a provider to this Service, but it must also be attached to the Service.
  • By default if a Service has only one module provider, the framework will attach this module to the Service
  • All providers will be attached to event Services, even if there are more than one provider
  • Else if a Service has more than one provider, the framework will not attach any provider to this service by default. To attach one or more providers to the Service, you must declare the attached services explicitely with the attach attribute
Note that if the framework property autoAttachProviders is set to true, it is not necessary to declare the attachment for each module.

Accepting multiple providers


By default only event Services allow to have multiple providers at the same time.

To change this behavior and allow publish Services and request-response Services to have multiple providers at the same time, you should set the acceptMultipleProviders framework property.

Service subscribers

A Service subscriber is a module which is notified from the Service invocation. Not that which subscriber is notified depends on the Service contract. For example:
  • A publish Service sends its datas to all its subscribers
  • Even if a request-response Service may have more than one subscriber, the provider only sends the response to the subscriber which sent the request

Enabling or disabling a module

Main Article: module configuration

By default a module:
  • Is enabled, which means that it can invoke services[3]
    Except if it has been detached from a particular service
    or be notified from services invocations
However it is possible to specify in the module configuration that a module is not enabled, which means that:
  • It will not invoke any service
  • It will not be notified or any service invocation
Note that it will not trigger any warning in the framwork if you try to invoke a service from a module if it is not enabled.

For example:
      <module name="InertialNavSystem1" isEnabled="false">

Notes

  1. ^ See Service-oriented framework on Wikipedia
  2. ^ It is perfectly valid for a Service to not have associated Datas at all. For example, it can be sufficient to be notified from the execution of an Event Service without the need to have any additional datas, such as a click on a Button for example
  3. ^ Except if it has been detached from a particular service

See also


Categories: concepts

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