Title: What algorithm does isCOBOL use to load framework properties (runtime config variables)?
In isCOBOL, the runtime configuration file is a Java properties file and is referred to in the documentation as the isCOBOL framework properties file.

The Java virtual machine allows you to specify properties with the -D command line option. The isCOBOL runtime properties file can be specified with the value of the iscobol.conf property.

For example:

java -Discobol.conf=myapp.cfg com.iscobol.invoke.Isrun MYAPP

or simply:

java -Discobol.conf=myapp.cfg MYAPP

With the wrapper: iscrun -c myapp.cfg MYAPP
or
iscrun -J-Discobol.conf=myapp.cfg MYAPP

isCOBOL uses the following algorithm for loading properties from the environment and/or the isCOBOL properties file. Properties read in each step override those read in previous steps:
  1. Read system environment variables such as those set with SET VAR=VAL. In this case the prefix "iscobol." is stripped from the name before it is looked up for the environment.
  2. Read properties from /etc/iscobol.properties if it exists
  3. Read properties from %HOMEPATH%/iscobol.properties if it exists
  4. Read the first iscobol.properties found in CLASSPATH
  5. Read the file specified in the command line as the value of the iscobol.conf property if it exists. iscobol.conf cannot be set in the environment (i.e. isCOBOL does not read the CONF environment variable).
  6. Read iscobol.properties file found in $ISCOBOL directory, if it exists.
  7. Read properties specified directly with -Discobol.* on the java command line
In the above, %HOMEPATH% is the user's home directory, and the iscobol.conf value can be the path of a regular disk file, a URL or the name of a class. When the name of a class is specified, isCOBOL searches for a file called iscobol.properties in the same directory or jar file that the class is located in.
Authored by: Veryant Support on Mon, Aug 31st, 2009 at 7:00 PM
This question has been viewed 9621 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=55

Powered by PHPKB Knowledge Base Software