Why and when to perform this task
This topic provides an overview of how to specify the run-time properties for C++ clients and servers. There are three ways to specify Object Request Broker (ORB) run-time properties:
Each of these methods is described in detail below.
Specifying properties in a file. To specify ORB run-time properties in a file, complete the following steps:
Here is an example of a properties file that might be used for a client:
Note: The lines beginning with a pound sign (#) are comment lines and are ignored.
# Set the bootstrap host and port. com.ibm.CORBA.bootstrapHostName=host1.company.com com.ibm.CORBA.bootstrapPort=9000 # Increase the request timeout from 3 minutes to 5 minutes (300 seconds). com.ibm.CORBA.RequestTimeout=300 # Load the transactions service during process initialization. com.ibm.CORBA.transactionEnabled=yesthat lines beginning with a pound sign (#) are comment lines and are ignored.
export WASPROPS=/dir1/dir2/client.props set WASPROPS=c:\dir1\dir2\client.props
In fact, you can specify multiple properties files by setting WASPROPS to a blank-separated list of filenames. This would be useful if you need to store commonly used properties in one file (for example, common.props), store client-specific properties in another file (for example, client.props), and store server-specific properties in yet another file (for example, server.props). For the client, you might set WASPROPS like this:
export WASPROPS=/dir1/dir2/common.props /dir1/dir2/client.props set WASPROPS=c:\dir1\dir2\common.props c:\dir1\dir2\client.props
For the server, you might set WASPROPS like this:
export WASPROPS=/dir1/dir2/common.props /dir1/dir2/server.props set WASPROPS=c:\dir1\dir2\common.props c:\dir1\dir2\server.props
Specifying properties with environment variables. To specify ORB run-time properties with environment variables, you first must set the WASGETENV environment variable to 1 (one) like this:
export WASGETENV=1 set WASGETENV=1
This indicates to the ORB to obtain properties first from the environment, then from any properties file or files provided to the ORB.
Next, you need to set environment variables that correspond to the desired run-time properties. To determine the correct variable name from the run-time property name, follow these steps:
export WASREQUESTTIMEOUT=300 set WASREQUESTTIMEOUT=300
The following shows how the previous two properties might be set using environment variables:
export WASGETENV=1 export WASREQUESTTIMEOUT=300 export WASLOGGER_FILEDETAIL=no set WASGETENV=1 set WASREQUESTTIMEOUT=300 set WASLOGGER_FILEDETAIL=no
Specifying properties with CORBA::ORB_init() argument strings. You can set properties by passing argument strings to the CORBA::ORB_init() function using the argc and argv parameters. The CORBA::ORB_init() function supports two ways to set properties:
The following is a code fragment that illustrates how to use these argument strings:
. . . char *argList[] = { "-Dcom.ibm.CORBA.RequestTimeout=300", "-Dcom.ibm.CORBA.logger.fileDetail=no", "-PropertiesFile=/dir1/additional.props" }; int argCount = 3; CORBA::ORB_ptr orb_ptr = CORBA::ORB_init ( argCount, argList, "DSOM" ); . . .