REQUIREMENT util.property.env |
Type | NEW |
Priority | LOW |
Status | INWORK |
Topic | The xmlBlaster.properties file and command line configuration | ||||||||||||||||||||||||||||||||||||||||
Des cription |
The xmlBlaster.properties file, JVM environment (system properties) and command line
settings allows to customize
the behavior of xmlBlaster and of xmlBlaster clients. java org.xmlBlaster.Main -help java HelloWorld3 -help Here are some examples: java org.xmlBlaster.Main -bootstrapPort 5600 -logging/org.xmlBlaster.util.protocol.RequestReplyExecutor FINEST java HelloWorld3 -bootstrapHostname myServer -bootstrapPort 5600 -logging FINE We force the server to listen on port 5600 and switch method call logging of the SOCKET component on. The client is configured to search for the server on host myServer on port 5600 and has switched trace logging on. The same could be done as Java virtual machine system properties: java -DbootstrapPort=5600 -Dlogging/org.xmlBlaster.util.protocol.RequestReplyExecutor=FINEST org.xmlBlaster.Main java -DbootstrapHostname=myServer -DbootstrapPort=5600 -Dlogging=FINE HelloWorld3 Forcing for example generally the port to 5600 could be done in $HOME/xmlBlaster.properties like: bootstrapPort=5600 Note that we ommit the dash - in the property file. All properties from the file are usable on command line or as JVM settings and vice versa. Precedence
Every property can be specified more or less qualified which introduces further precedence levels in location 2, 3 and 4 of the above precedence locations:
Environment variables replacementAny property you specify you can use as a variable in other properties, regardless of if they are from the property file or from command line or from the JVM environment. If you have recursion of properties referencing each others we give up at fifty nested levels. Examples for reuse of properties: MyHostname=server.com.universe bootstrapHostname=${MyHostname} plugin/xmlrpc/hostname=${MyHostname} plugin/socket/hostname=${MyHostname} All environment variable (e.g. ${java.io.tmpdir}="/tmp", ${file.separator}="/") can be used in the properties file or on command line and are replaced on occurrence: java org.xmlBlaster.Main -plugin/ior/iorFile '${file.separator}tmp${file.separator}Server.ior' This dumps the CORBA IOR to the file /tmp/Server.ior on UNIX and to \tmp\Server.ior on Windows. These are often helpful variables
user.dir and user.home are without a path separator at the end. Note:If a variable cannot be resolved the library throws an exception and
stops execution. If you want to allow unresolved variables write them
like |
||||||||||||||||||||||||||||||||||||||||
Example Java |
The variables which you specify with ${...} will be replaced by their values. The variable may be from the System properties, xmlBlaster.properties or from the command line. For example you could define a variable in xmlBlaster.properties: XMLBLASTER_HOME=${user.home}/xmlBlaster and use it as a variable in this file, e.g. MY_XSL_DIR=${XMLBLASTER_HOME}/xsl Note the use of the JVM property 'user.home'. Another example could be java -DmyName=joe ... and use it as a variable in this file, e.g. TEXT=Hello ${myName}, have a nice day. |
||||||||||||||||||||||||||||||||||||||||
Configure |
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details. |
||||||||||||||||||||||||||||||||||||||||
Todo |
|
||||||||||||||||||||||||||||||||||||||||
See REQ | util.property | ||||||||||||||||||||||||||||||||||||||||
See REQ | admin.commands | ||||||||||||||||||||||||||||||||||||||||
See REQ | client.configuration | ||||||||||||||||||||||||||||||||||||||||
See API | org.xmlBlaster.util.property.PropEntry | ||||||||||||||||||||||||||||||||||||||||
See TEST | org.xmlBlaster.test.AllTests |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/util.property.env.xml