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

Framework initialization and runtime sequence



This article presents the framework initialization, runtime, and shutdown sequences.

Initialization sequence

The initialization sequence of the framework has two main phases:

Note that:
  • The setup phase will create definition classes which will manage the definition
  • The start phase will create runtime classes which will manage the runtime

frameworkSequence

Framework preconfiguration

When a module preconfigure EntryPoint is called, the Services are still not attached for the module, but it is possible to specify programmatically modules properties. For example:
      public void preConfigure() {
        module.addPropertyType("myProperty", URL.class, null, true);
      }

Framework initialization

When a module init EntryPoint is called, the Services are attached for the module, but the module will not be notified of any service, and it will not be able to invoke a service.

It is possible to get the properties values, and the Services for which the module is a provider or a subscriber. For example:
      public void init(Module module) {
        this.module = module;
        this.inputService = module.getService("theService");
        boolean property = module.getPropertyBooleanValue("myProperty");
      }
This is also the ideal moment to perform lengthy setup or initializations for your module, if you have some code which will take a long time to complete.

Framework start

When a module start EntryPoint is called, all the framework is initialized and the Services are attached. It is possible to send services to a service subscriber. For example:
      public void start() {
        inputService.setDataValue("myValue", true);
        inputService.invoke();
      }

Runtime sequence

Main Article: Service invocation

The runtime sequence for a Service invocation has the following phases:
  • The module which is a provider sets values for the Service datas, then invokes the Service
  • The modules which are subscribers for this Service are notified from the Service invocation, then gets the values for the Service datas

sequenceruntime

Shutdown sequence

When the framework is shutdown, the modules end EntryPoint will be called (for the modules which have this entry point).

frameworkSequenceEnd

Consequences from the deployment

Main Article: Framework deployment

In cases where several protoframework.jar instances are deployed, the initialization sequence will be performed for each instance. Note that in this case the instances have no way to know when the other instances are ready, which means that if you invoke services at start of one module, subscriber modules on other instances may not be ready yet to be notified[1]
Especially if you use the UDP protocol
.

Notes

  1. ^ Especially if you use the UDP protocol

See also


Categories: concepts

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