Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…


Runtime configuration file can be dynamized using environment variables and Java Properties.

When starting, the Runtime will automatically retrieve and use the specified variables, with a mechanism allowing to specify a default value if it does not exist.

Prerequisites:

  • Stambia DI Runtime S17.6.2 or higher

 

Using environment variables and Java Properties

 

When administering the Runtime configuration file (engineParameters.xml), the following syntax must be used:

${java.property|environment.variable:<VARIABLE_NAME>[:<DEFAULT_VALUE>]}

 

It is composed of the three colored parts below:

${java.property|environment.variable:<VARIABLE_NAME>[:<DEFAULT_VALUE>]}

 

Description of each part:

Part Mandatory Description
java.property | environment.variable yes

Type of variable to use between the following two types.

Java.property

Java Property available in the Java process started for the Runtime.

These can be either System Properties or user defined properties transmitted through -Doption=value on the Runtime startup Java command.

environment.variable

Environment variables available in the machine.

VARIABLE_NAME yes Name of the variable to retrieve
DEFAULT_VALUE no

Optional default value to use if the variable does not exist.

If no default value is specified an error will be thrown at Runtime startup if the variable does not exist.

Environment variables and Java Properties can be used for any value the Runtime Configuration file.

 

Examples

 

Using an environment variable to define the Runtime RMI Port

<parameters>
    <...>
    <engineParameters>
        <...>
        <parameter name="rmiPort" value="${environment.variable:STB_RUNTIME_PORT}"/>
        <...>
    </engineParameters>
    <...>
</parameters>

 

Using an environment variable to define the Runtime RMI Port, with a default value

<parameters>
    <...>
    <engineParameters>
        <...>
        <parameter name="rmiPort" value="${environment.variable:STB_RUNTIME_PORT:42000}"/>
        <...>
    </engineParameters>
    <...>
</parameters>

 

Using a Java Property to add the user name inside the temporary folder path:

<parameters>
    <...>
    <engineParameters>
        <...>
        <parameter name="temporaryFolder" value="temp/${java.property:user.name"/>
        <...>
    </engineParameters>
    <...>
</parameters>

 

Using a Java Property to add the user name inside the temporary folder path, with a default value:

<parameters>
    <...>
    <engineParameters>
        <...>
        <parameter name="temporaryFolder" value="temp/${java.property:user.name:default"/>
        <...>
    </engineParameters>
    <...>
</parameters>

 

 

Articles

Suggest a new Article!