Specifying run-time properties for CORBA C++ clients and servers

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:

  1. Create a simple text file, for example, client.props.
  2. Add the desired run-time properties to the file. The properties and values that you choose depend on your use of the ORB and are selected from the properties listed in the reference topic Runtime properties for CORBA clients and servers.

    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=yes
    

    that lines beginning with a pound sign (#) are comment lines and are ignored.
  3. Set the WASPROPS environment variable to the name of the properties file. An example follows:
    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:

  1. Remove the com.ibm.CORBA. prefix (RequestTimeout) starting with the full property name (for example, com.ibm.CORBA.RequestTimeout).
  2. Change the result to uppercase (REQUESTTIMEOUT).
  3. Add the WAS prefix (WASREQUESTTIMEOUT).
  4. Use the resulting string as the environment variable name, like this:
    export WASREQUESTTIMEOUT=300
    set WASREQUESTTIMEOUT=300
  5. Convert any periods (.) to underscores (_) in the string from the preceding step. For example, if you need to set the com.ibm.CORBA.logger.fileDetail property, use the WASLOGGER_FILEDETAIL environment variable.

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" );

.
.
.


Related tasks
Managing CORBA applications
Related reference
Run-time properties for CORBA clients and servers



Searchable topic ID:   tcor_pgmc3
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/tasks/tcor_pgmc3.html

Library | Support | Terms of Use | Feedback