getPropertyxxx
methods.allServices.updateCap
: the default property allowing to set an update cap in ms for all Services for a ModulepublishServices.updateCap
: the default property allowing to set an update cap in ms for publish Services for a Module.<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="publishServices.updateCap" value="500" /> </module> </application> </properties>
globalProperty
element allows to specify properties which can be shared by several modules. It can be useful if you want several modules to have the same value for the same property name. <applications> <application name="myAppli"> <modules> <module name="module1"> <properties> <property key="prop1" type="int" /> <property key="prop2" type="url" /> </properties> </module> <module name="module2"> <properties> <property key="prop1" type="int" /> </properties> </module> </application> </applications>and the properties specification:
<properties> <globalProperty key="prop1" key="3" /> <application name="appli1" > <module name="module1" > <moduleProperty key="prop2" value="my/file.xml" /> </module> <module name="module2" /> </application> </properties>It is equivalent to the following properties specification:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop2" value="my/file.xml" /> </module> <module name="module2" > <moduleProperty key="prop1" value="3" /> </module> </application> </properties>
var
element allows to specify variables which values can be used by several properties. The values defined for these properties can be used for any property by using the "${var key}" construct.<properties> <var key="globalVar" key="500" /> <application name="appli1" > <module name="module1" > <moduleProperty key="prop1" value="${globalVar}" /> </module> <module name="module2" > <moduleProperty key="myProperty" value="${globalVar}" /> </module> </application> </properties>Note that variables defined in the properties file take precedence over the properties defined for the framework in the framework properties.
allowConfigVariables
is set to false
, then the proeprty will not take variables into account.<module name="myModule" > ... <properties> <property key="myProperty" type="string" /> </properties> </module>For the following properties configuration:
<properties> <var key="globalVar" key="500" /> <application name="appli" > <module name="myModule" > <moduleProperty key="myProperty" value="${globalVar}" /> </module> </application> </properties>The value of the property will be the String "500".
<module name="myModule" > ... <properties> <property key="myProperty" type="string" allowConfigVariables="false" /> </properties> </module>The value of the property will be the String "${globalVar}".
getPropertyxxxValue(propertyName)
or getPropertyxxxValue(propertyName, unit)
for properties with units.
module
element under the application
element.appli1
has only one module named module1
, the two following declarations for the properties are equivalent:<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop3" value="3" /> </module> </application> </properties>and
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop3" value="3" /> </module> </application> </properties>
<properties> <application name="appli1" > <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop3" value="3" /> </application> </properties>
<properties> <property key="appli1.module1.prop1" value="3" /> <property key="appli1.module1.prop3" value="3" /> </properties>
<properties> <propertyGroup> <propertyArray key="prop1" type="int" /> <propertyArray key="prop2" type="url" /> </propertyGroup> </properties>We can have for example the following properties configuration:
<properties> <arrayProperty key="appli1.module1.prop1"> <value value="3" /> <value value="4" /> </arrayProperty> <arrayProperty key="appli1.module1.prop2"> <value value="http://docs.oracle.com/javase/8/docs/api" /> <value value="http://docs.oracle.com/javase/8/docs" /> </arrayProperty> </properties>or we can also have:
<properties> <application name="appli1" > <module name="module1" > <moduleArrayProperty key="prop1"> <value value="3" /> <value value="4" /> </moduleArrayProperty> <moduleArrayProperty key="prop2"> <value value="http://docs.oracle.com/javase/8/docs/api" /> <value value="http://docs.oracle.com/javase/8/docs" /> </moduleArrayProperty> </module> </application> </properties>
<properties> <propertyArrayGroup key="array1" mandatory="true"> <property key="prop1" type="int" /> <property key="prop2" type="int" /> </propertyArrayGroup> <property key="prop3" type="int" mandatory="true"/> </properties>We can have for example the following properties configuration:
<properties> <application name="appli1" > <module name="module1" > <moduleArrayGroupProperty key="array1"> <moduleArrayValue> <moduleProperty key="prop1" value="1" /> <moduleProperty key="prop2" value="2" /> </moduleArrayValue> <moduleArrayValue> <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop2" value="4" /> </moduleArrayValue> </moduleArrayGroupProperty> <moduleProperty key="prop3" value="3" /> </module> </application> </properties>or we can also have:
<properties> <arrayGroupProperty key="appli1.module1.array1"> <arrayValue> <property key="appli1.module1.prop1" value="1" /> <property key="appli1.module1.prop2" value="2" /> </arrayValue> <arrayValue> <property key="appli1.module1.prop1" value="3" /> <property key="appli1.module1.prop2" value="4" /> </arrayValue> </arrayGroupProperty> <property key="appli1.module1.prop3" value="3" /> </properties>Both these two cases are equivalent. In these two cases we will have two array of int properties for "prop1" and "prop2" (stored asd a List), which can be retrieved by Module.getPropertyIntArrayValue(String).
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="prop1" > <mapValue key="key1" value="value1" /> <mapValue key="key2" value="value2" /> </moduleProperty> </module> </application> </properties>
<property key="myProp" type="int"/>And we have in the properties configuration:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="myProp" value="150"/> </module> </application> </properties>To retrieve the value of the property in the module:
public void init(Module module) { // the value will be 150 int value = module.getPropertyFloatValue("myProp"); }
<property key="myProp" type="float" unit="nm"/>And we have in the properties configuration:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="myProp" value="18520" unit="m"/> </module> </application> </properties>The value of the property in Nautical miles will be "10".
public void init(Module module) { // here valueNM will be 10 float valueNM = module.getPropertyFloatValue("myProp", Units.NM); // here valueM will be 18520 float valueM = module.getPropertyFloatValue("myProp", Units.M); }
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence