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

Configuration



The framework configuration is defined in one or several XML files, each one refering to several separated configurations:
  • The libraries paths declarations which allow to declare native paths for libraries used for modules
  • The environment and property variables declarations. These variables can be used in most of the framework properties
  • The data data types defined for the framework
  • The services defined in the framework. The Service datas refer to types defined in the data types
  • The applications instanciated in the framework. These applications provide or subscribe to Services
  • The network configuration between the applications[1]
    This definition is optional, if it is not present, the communication will be assumed to be in the same JVM. This means that you don't need to define a network configuration if you only use one framework instance in your configuration
  • The properties of the applications
  • General properties for the framework, specified with the property element. See Framework properties for more information
The Data types Services Applications, and Network configurations are specified with the file element, each defining the relative or absolute path for the corresponding XML file.

Example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <file url="properties.xml" />
         <property key="logStackTraces" value="true" />
         <property key="logMaximumLines" value="200" />
      </files>

Grammar

See the grammar for the configuration schema.

file element

Each of the configuration file is referred to by the simple line:
      <file url="the file" />
Note that:
  • It is not necessary to specify the type of each file. The configuration parser will infer the type from the name of the top-level element[2]
    For example, if the name of the top-level element for a file is services, the parser will assume that the file is a services configuration file
  • It is valid to have more than one file of the same type (such as for example several applications configuration files)
  • The order of the files declarations in the configuration is not relevant
  • You can include files within files. See include element for more information

include element

The include element allows to include another configuration file in another. For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <include url="included.xml" />
      </files>

property element

Main Article: Framework properties

The property element allows to set the value of a framework property. For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <property key="logStackTraces" value="true" />
      </files>

Showing the values of properties


The echo element allows to show the value of an environment variable or a confProperty.

Starting the framework

As explained in the command-line starting article, starting the framework with the configuration is:
      java -jar protoframework.jar config=filelist.xml
It is also possible to use more than one configuration file, for example:
      java -jar protoframework.jar config=filelist1.xml;fileliste2.xml

Examples

Basic example

      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
      </files>

Example with properties and network configuration

      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <file url="network.xml" />
         <file url="properties.xml" />
      </files>

Example with general framework properties

      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <file url="network.xml" />
         <property key="logStackTraces" value="true" />
         <property key="logMaximumLines" value="200" />
      </files>

Example with environment variables declaration

      <files>
         <env key="APPLIS" />
         <file url="${APPLIS}" />
         <file url="services.xml" />
         <file url="types.xml" />
      </files>

Example with an include declaration

      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <include url="included.xml" />
      </files>
With the following content for the include declaration:
      <files>
         <property key="logStackTraces" value="true" />
         <property key="logMaximumLines" value="200" />
      </files>
It is equivalent to:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
      <property key="logStackTraces" value="true" />
         <property key="logMaximumLines" value="200" />
      </files>

Notes

  1. ^ This definition is optional, if it is not present, the communication will be assumed to be in the same JVM. This means that you don't need to define a network configuration if you only use one framework instance in your configuration
  2. ^ For example, if the name of the top-level element for a file is services, the parser will assume that the file is a services configuration file

See also


Categories: config

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