.
java -jar protoframework.jar config=filelist.xml minimizeGUI
windowTitle and fullWindowTitle properties specify the name which must be shown in the GUI window.windowTitle property will append the title to the default GUI window namefullWindowTitle property will replace the title<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="windowTitle" value="Sample 1" /> </files>has the following result on the GUI window:
<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="fullWindowTitle" value="Sample 1" /> </files>has the following result on the GUI window:
consolePosition property allow to specify he position of the GUI window. The format is <x position;>;<y position;. For example:<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="consolePosition" value="500;500" /> </files>
logMaximumLines property specifies the maximum number of lines of the Logger.
logFile property specifies a file which will be used to write the logs.
logStackTraces property can be set to specify that stack traces must be presented in the case of exceptions encountered in the framework. By default only the name of the exception will be shown in the Logger.
printStackTrace property allows to print the errors stackTrace on the console.
logLevel property specifies which message levels will be logged by the Logger. The supported values are[1]
// will be logged by default, except if the log level is set to "OFF" Logging.error("the error"); // will only be logged if the log level is set at least to "WARNING" Logging.error("the error", Level.WARNING); // will only be logged if the log level is set at least to "INFO" Logging.info("the error", Level.INFO);
failFast property can be set to specify that the framework must throw an exception in the following cases rather than log an error:false (an error will be logged in these cases).<files> ... <property key="failFast" value="true" /> </files>
eventServicesCopyDatas.<files> ... <property key="eventServicesCopyDatas" value="true" /> </files>
acceptMultipleProviders.<files> ... <property key="acceptMultipleProviders" value="true" /> </files>
autoAttachProviders.<files> ... <property key="autoAttachProviders" value="true" /> </files>
debugScripts property can be set to simplify debugging Groovy or Python scripts.<files> ... <property key="debugScripts" value="true" /> </files>
libPath element allows to declare where to find the native libraries used with java modules. For example:<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <file url="properties.xml" /> <libPath url="my/lib" /> </files>
showLibVersion property can be set to show the version of the applications jar files on the logger. Note that a library version for an application will only be shown on the logger if the Manifest of the Application jar file has the Version manifest property.Version: 12.1This will show in the logger:
supportXInclude property allows to include portions of the XML documents using the xInclude mechanism. It help to define only once an XML structure (such as the interfaces of a module) and reuse them in several configurations.<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <file url="properties.xml" /> <property key="supportXInclude" value="true" /> </files>
defaultChangeBehavior allows to specify how complex datas are considered as changed by default. There are two modes:changed specifies that the full graph of a complex datas is taken into account to detected if the data has changedunchanged specifies that normally a complex data is always considered as changedchanged value is used by default.<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="defaultChangeBehavior" value="unchanged" /> </files>
serviceInvocationMode property allows to specify if the services will be invoked in a background Thread managed by an ExecutorService[3]
serviceInvocationDomain property allows to specify if there will be one separate Thread pool for each module or one unique pool for all the Framework, shared by all modulesservicesExecutorPool property allows to specify the number of Threads used in the poolserviceInvocationMode is executorService, which means that a Thread pool will be usedservicesExecutorPool is 1, which means that only one Thread will be usedserviceInvocationDomain is module, which means that there will be one pool for each moduleserviceInvocationMode is blocking, the two other propeties are not used.
serviceInvocationMode property allows to specify how the services invocation will be performed:executorService value, the framework will perform the invocation in a background Threadblocking value, the framework will perform the invocation in the same Thread as the caller<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="serviceInvocationMode" value="blocking" /> </files>
serviceInvocationDomain property allows to specify the on which domain the service executor pool will work:module value, the framework will create one separate ExecutorService for each moduleglobal value, the framework will create only one ExecutorService for all the modules<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="serviceInvocationDomain" value="global" /> </files>
servicesExecutorPool property allows to specify the number of Threads which will be used in the background Threads pool if the framework perform the services invocation in a background Thread. By default there is only one Thread in the pool. Of course this property is not useful if the invocations are blocking (performed in the same Thread as the caller).<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="serviceInvocationMode" value="executorService" /> <property key="servicesExecutorPool" value="5" /> </files>
allowNestedClassLoaders property specify how the modules will be loaded if the filelist configuration is an entry in a jar file or zip file:URLClassLoader will be usedtrue, a special URLClassLoader which is able to loa Jar files nested in jar files will be used. This will only be used through if the filelist configuration is a jar of zip file entryzipfile.zip - filelist.xml - applications.xml - services.xml - types.xml - EmbeddedLibraries.jarWith the following content for the
filelist.xml file:<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="allowNestedClassLoaders" value="true" /> </files>We can do:
java -jar protoFramework.jar config=jar:file:/zipfile.zip!/filelist.xml
useGlobalClassLoaders will specify that if the configuration is specified as an entry of a jar file, the jar file will be automatically added to the general ClassLoader.
MyConfig.jar - META-INF - MANIFEST-MF - filelist.xml - applications.xml - services.xml - types.xml - org - samples - Module.classWith the following content for the
filelist.xml file:<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="useGlobalClassLoaders" value="true" /> </files>We can do:
java -jar protoFramework.jar config=jar:file:/MyConfig.jar!/filelist.xml
debugLog property can be used to help with debugging. It specifies a file which will be used so as the module can log messages. For example:<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="debugLog" value="myFile.log" /> </files>The following method can be used by modules to log messages to both the console and this log file:
DebugBuffer.println(message);The file will be automatically flushed when the framework is shutdown.
eventLogger element allows to use a recorder engine which will record all invocations and notifications in the framework.url attribute declares the jar file of the library which will be used to perform the recordscenario attribute declares the file to use to serialize the recordautoStart attribute is an optional attribute specifying if the record must begin as soon as the framework starts<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <eventLogger url="perfoLogger.jar" scenario="logged.xml"/> </files>
customFactories property allows to specify the paths for the user-defined module types, which allow to define your own kind of modules and refer to them in the applications configuration. For example, you could define specific module types to handle Simulink modules, or other kinds of modules linked to any other framework or library.<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <file url="properties.xml" /> <property key="customFactories" value="myPythonFactory.jar;simulinkFactory.jar" /> </files>
confProperty element. This element has two mandatory attributes:key: the name of the variablevalue: the value of the variableallowSetByLauncher: allow to set the value of the variable through the launcher arguments<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <confProperty key="myPath" value="D:/my/directory/" </files>For example, we can use this property in the properties configuration file:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="theGraphicPath" value="${myPath}/graphic.xml" /> </module> </application> </properties>
true value to the allowSetByLauncher attribute. In that case:value attribute specifies the value which will be used to set the user-defined property if the launcher does not define this value<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <confProperty key="myPath" value="D:/my/directory/" allowSetByLauncher="true" /> </files>If we start the framework by:
java -jar protoframework.jar config=filelist.xml
The myPath value will have the D:/my/directory/ value.
java -jar protoframework.jar config=filelist.xml myPath=D:/the/other/directory
The myPath value will have the D:/the/other/directory value.
env element. This element can have two attributes:key: (mandatory) the name of the system environment variabledefault: (optional) the default value of the variable if the environment variable does not exist<files> <env key="APPLIS" /> ... <file url="config/${APPLIS}" /> </files>It is also possible to set the value for an environment variable, with the
setenv element. This element can have these attributes:key: (mandatory) the name of the system environment variablevalue: (mandatory) the value of the variableoverwrite: (optional) true if it is allowed to overwrite the current value of the environment variable if it already exists<files> <setenv key="APPLIS" value="applications.xml" /> </files>
echo element allows to show the value of an environment variable or a confProperty[4]
type has the value "env", it shows the value of an environment variable. It can be a variable set in the system before the start of the framework or a variable set through the setenv elementtype has the value "confProperty", it shows the value of a confProperty declaration<files> <env key="APPLIS" /> <confProperty key="theProperty" value="theValue" /> <file url="${APPLIS}" /> <file url="services.xml" /> <file url="types.xml" /> <echo type="env" key="APPLIS" /> <echo type="confProperty" key="theProperty" /> </files>
<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="logStackTraces" value="true" /> <property key="logMaximumLines" value="200" /> <property key="logFile" value="myFile.log" /> <property key="acceptMultipleProviders" value="true" /> <property key="pythonRuntime" value="C:/Program Files (x86)/Python24/python.exe" /> <property key="showLibVersion" value="true" /> </files>
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence