Configuring and initializing the ORB runtime

ORB properties define the class name of the ORB driver that will be used, and configure settings required by the driver. Properties can be set externally in HTML parameters for a Java applet or in command-line arguments for a Java application. You can also set them directly in your source code in both applets and applications. Table 13-1 describes the EAServer ORB properties.

Table 13-1: EAServer Java ORB properties

Property

Specifies

org.omg.CORBA.ORBClass

The class that implements interface org.omg.ORB. Specify com.sybase.CORBA.ORB to indicate the EAServer ORB driver class. There is no default for this property.

com.sybase.CORBA. ConnectionTimeout

For applications that run in a cluster, sets a time limit to receive a server response before the connection fails over to try another server in the cluster. Setting this property ensures that failover happens without an unreasonable delay. Specify the timeout period in seconds. The default of 0 indicates no time limit.

com.sybase.CORBA.forceSSL

If set to true when using a a reverse proxy server, forces use of SSL for the connection to the reverse proxy. Set this property to true if the connection to the reverse proxy must use SSL (HTTPS) tunnelling, but the connection from the proxy to the server does not use SSL tunnelling. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information on connecting to EAServer through proxy servers.

com.sybase.CORBA.GCInterval

Specifies how often the ORB forces deallocation (Java garbage collection) of unused class references. Though this property is set on an individual ORB instance, it affects all ORB instances. The default is 30 seconds. The default is appropriate unless you have set an idle connection timeout of less than 30 seconds. In that case, you should specify a lower value for the garbage collection interval, since connections are only closed while performing garbage collection. In other words, the effective idle connection timeout ranges from the idle connection timeout setting to the smallest integral multiple of the garbage collection interval.

com.sybase.CORBA.http

Specify whether the ORB should use HTTP tunnelling without trying to use plain IIOP first. The default is false. With the default setting, the ORB tries to open a connection using plain IIOP, and switches to HTTP tunnelling if the plain IIOP connection is refused. The default is appropriate when some users connect through firewalls that require tunnelling and others do not; the same application can serve both types. If you know tunnelling is required, set this property to true. This setting eliminates a slight bit of overhead that is incurred by trying plain IIOP connections before tunnelling is used.

com.sybase.CORBA. HttpExtraHeader

An optional setting to specify what extra information is appended to the header of each HTTP packet when connecting through a Web proxy. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information.

com.sybase.CORBA.http. jaguar35Compatible

When set to true, specifies that HTTP tunnelling must be compatible with servers running EAServer version 3.5 or older installations. The default is false.

com.sybase.CORBA. HttpUsePost

When using HTTP tunnelling, specifies the HTTP request type used. A value of true indicates that POST requests are to be used. A value of false (the default) specifies that GET requests are to be used.

Some Web browsers cannot handle the long URLs generated when using HTTP tunnelling with GET requests. Setting this property to true can work around the issue.

com.sybase.CORBA. IdleConnectionTimeout

Specifies the time, in seconds, that a connection is allowed to sit idle. When the timeout expires, the ORB closes the connection. The default is 0, which specifies that connections can never timeout. The connection timeout does not affect the life of proxy instance references; the ORB may close and reopen connections transparently between proxy method calls. Specifying a finite timeout for your client applications can improve server performance. If many instances of the client run simultaneously, a finite client connection timeout limits the number of server connections that are devoted to idle clients. A finite timeout also allows rebalancing of server load in an application that uses a cluster of servers.

If you specify an idle connection timeout, make sure the garbage collection interval (com.sybase.CORBA.GCInterval) is set to an equal or lesser value.

com.sybase.CORBA.isApplet

Specifies whether the client is a Java applet. The default is false unless the ORB is initialized by calling the Orb.init method that takes a java.applet.Applet instance as a parameter. If you call another version of init from a Java applet, you must set this property to true in order to connect to EAServer using SSL.

com.sybase.CORBA.local

For server-side component use only. Specifies whether the ORB reference can be used to issue intercomponent calls in user-spawned threads. The default is true, which means that intercomponent calls are made in memory and must be issued from a thread spawned by EAServer. Set this property to false if your component makes intercomponent calls from user-spawned threads.

com.sybase.CORBA.ProxyHost

Specifies the machine name or the IP address of a reverse-proxy server. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information.

com.sybase.CORBA.ProxyPort

Specifies the port number of a reverse-proxy server. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information.

com.sybase.CORBA.RetryCount

Specify the number of times to retry when the initial attempt to connect to the server fails. The default is 5.

com.sybase.CORBA.RetryDelay

Specify the delay, in milliseconds, between retry attempts when the initial attempt to connect to the server fails. The default is 2000.

com.sybase.CORBA. socketReuseLimit

Specify the number of times that a network connection may be reused to call methods from one server. The default is 0, which indicates no limit. The default is ideal for short-lived clients. The default may not be appropriate for a long-running client program that calls many methods from servers in a cluster. If sockets are reused indefinitely, the client may build an affinity for servers that it has already connected to rather than randomly distributing its server-side processing load among all the servers in the cluster. In these cases, the property should be tuned to best balance client performance against cluster load distribution. In Sybase testing, settings between 10 and 30 proved to be a good starting point. If the reuse limit is too low, client performance degrades.

com.sybase.CORBA. WebProxyHost

The host name or IP address of an HTTP proxy server that supports generic Web tunnelling, sometimes called connect-based tunnelling. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information. There is no default for this property, and you must specify both the host name and port number properties.

com.sybase.CORBA. WebProxyPort

When generic Web tunnelling is enabled by setting com.sybase.CORBA.WebProxyHost, this property specifies the port number at which the HTTP proxy server accepts connections. See Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide for more information. There is no default for this property, and you must specify both the host name and port properties.

com.sybase.CORBA. useJSSE

Use the Java Secure Sockets Extension (JSSE) classes for secure HTTP tunnelled (HTTPS protocol) connections. JSSE provides an alternative to the built-in SSL implementations when secure connections are needed from an applet running in a Web browser. Additional configuration may be required to use this option. See Chapter 4, “Using SSL in Java Clients,” in the EAServer Security Administration and Programming Guide for more information.

Example: ORB Initialization in an Applet ORB initialization for a Java applet is demonstrated in the example below. This code constructs a java.util.Properties object and sets the required properties. The applet reference and the Properties object are passed to the org.omg.CORBA.ORB.init method.

import java.applet.*;
import org.omg.CORBA.*;
public class myApp extends Applet {

  public void init() {
    ...
    java.util.Properties props 
        = new java.utils.Properties();
    props.put("org.omg.CORBA.ORBClass",
       "com.sybase.CORBA.ORB");
    ORB orb = ORB.init(this, props);
    ...

Rather than property values, you can pass properties to the ORB as parameters in the HTML APPLET tag that loads the applet, as in the example below:

<APPLET 
codebase=....
<param name="org.omg.CORBA.ORBClass" 
  value="com.sybase.CORBA.ORB">
... 
</APPLET>

A property setting that is passed as an applet parameter supersedes any setting that is specified in the java.utils.Properties parameter to the ORB.init method. If you want to ensure that hard-coded property values are used, pass the Applet parameter as null.

Example: ORB Initialization in an Application ORB initialization for a Java application is demonstrated in the example below. This code constructs a java.util.Properties object and sets the required properties. The command-line parameters are passed to the org.omg.CORBA.ORB.init method.

import java.util.*;

public class myApp extends Object {

  public static void main(String[] args) 
     throws Exception 
{
    ...
    Properties props = new Properties();
    props.put("org.omg.CORBA.ORBClass",
       "com.sybase.CORBA.ORB");
     ORB orb = ORB.init(args, props);
    ...

Rather than hard-coding the property values, you can pass them to the ORB as command-line parameters, as in the example below:

java yourclass -org.omg.CORBA.ORBClass com.sybase.CORBA.ORB

Properties that are specified as command-line parameters supersede values specified in the java.utils.Properties parameter to the ORB.init method. If you want to ensure that hard-coded property values are used, pass the String[ ] parameter to init as null.