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

ServiceTemplate usage



The ServiceTemplates class allows to get the definition of the services defined in the autodescripted module manifest, and check the compatibility of a Service with the stored definition.

Check the compatibility of a Service

The following methods allow to check the compatibility of a Service with the stored definition:

Example

In this example, we want to check if one service is present and compatible with a module declaration.
      // create a ServiceTemplates with the XML files defining the expected servixes and types
      ServiceTemplates template = new ServiceTemplates(module, <services definition>, <types definition>);

      // get the service to check
      ServiceInstance<?, ?> service = ...

      // // check a service, not taking into account its direction, the module can provide the service or subscribe to it
      short state = template.checkService(service);

      // check a service, the service will be considered unconsistent if it is not provided by the module
      state = template.checkService(service, ServiceTemplates.PROVIDER);

      // check a service, the service will be considered unconsistent if the module does not subscribe to it
      state = template.checkService(service, ServiceTemplates.SUBSCRIBER);

Return the provider or subscriber interfaces

The following methods allow to return the provider or subscriber interfaces declared in the stored definition:

See also


Categories: concepts

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