Orbix.cfg
. This file contains a set of variable values which configure the operation of the OrbixWeb daemon process and, to a lesser extent, the IDL compiler.
Configure
. This class is used in the configuration of OrbixWeb applications during initial compilation.
By default, the OrbixWeb configuration file is installed in the OrbixWeb installation directory. In order to allow the OrbixWeb daemon and the IDL compiler to locate this file, the
IT_CONFIG_PATH
environment variable should be set. If the
IT_CONFIG_PATH
variable value is a directory, the directory should contain the file named Orbix.cfg
. If the IT_CONFIG_PATH
environment variable is the full pathname of a file, that file will be used as the configuration file.Note that on Windows NT,
IT_CONFIG_PATH
must be a system, rather than a user environment variable. On UNIX, if Orbix.cfg
is installed in the /etc
directory, it will be automatically located and no IT_CONFIG_PATH
setting is required.
Orbix.cfg
file provides default settings for the main configuration variables required by OrbixWeb. Programmers may change these default settings either by editing the configuration file or by setting a variable in the user's environment. An environment variable, if set, takes precedence over the value set in the configuration file.The following variables may be set in the
Orbix.cfg
file.The individual entries are explained in more detail in subsequent subsections.
<entry name> <entry value>Running the command:
orbixd -v
outputs the configuration settings that the orbixd
daemon would use; it does not cause the daemon to be run.
<error number>: <error message text>for each error.
This standard file can be edited for a particular installation if required; for example by translating all of the text into French or German, or by providing more verbose explanations of errors than those provided in the standard OrbixWeb daemon release.
Rather than changing the master file distributed with OrbixWeb, an alternative file can be specified using the
IT_ERRORS
entry in the OrbixWeb configuration file, or on a per user basis by setting the value of the IT_ERRORS
environment variable to a file which contains the list of system error messages. If the IT_ERRORS
environment variable is not defined, then the OrbixWeb daemon will output the error messages in the file named by the IT_ERRORS
entry in the system configuration file.Within the
IT_ERRORS
file, comments can be inserted using "//
", and `\
' can be used as a continuation character if the message needs to extend past the end of line.Note that the
IT_ERRORS
file is only referenced by the OrbixWeb daemon process. Alterations to this file will not affect the error messages displayed by the IDL compiler, or the contents of OrbixWeb system exception descriptions. To alter the content of these error messages, the programmer should edit or replace the OrbixWeb class
ErrorMsgs
, the source code of which is supplied with each OrbixWeb installation. The format of error messages defined in this class is similar to that in the OrbixWeb error messages file, where each error is an element of a Java switch
statement, contained in the static method lookup_message()
as follows:
// Java // In file ErrorMsgs.java. package IE.Iona.Orbix2.CORBA; public class ErrorMsgs { ... static String lookup_message (int minor_code) { switch (minor_code) { case <error number>: return <error message text>; } return null; } }
IT_IMP_REP_PATH
in the system configuration file. Once this has been set by the system installer, it is unlikely that programmers will have to use an alternative storage location.Occasionally it might be useful for a group of programmers to have their own Implementation Repository store (this might be done when running a separate daemon with a different daemon port). Programmers can specify a different location by setting the
IT_CONFIG_PATH
to refer to a configuration file that specifies a different location for the IT_IMP_REP_PATH
entry or by setting the IT_IMP_REP_PATH
environment variable.
IT_INT_REP_PATH
configuration entry. This entry must be specified, and the corresponding directory must be created (usually by the system installer), before the Interface Repository can be used.For further details of the Interface Repository, see Chapter 20, "Interface Repository" of the OrbixWeb Programming Guide.
3.1.6 OrbixWeb Daemon Port
The daemon process orbixd
is used on each site running OrbixWeb servers to await incoming requests for server activations and to connect new clients to existing server processes. (It is not involved in subsequent communications.)IT_DAEMON_PORT
entry in the OrbixWeb configuration file, Orbix.cfg
. On UNIX, if there is an entry for orbixd
in the /etc/services
system configuration file, then this entry is used in preference to the one in Orbix.cfg
.IT_DAEMON_PORT
or by using a different system configuration file Orbix.cfg
(as given by the IT_CONFIG_PATH
environment variable).
IT_DAEMON_PORT
.
orbixd
entry in /etc/services
.
IT_DAEMON_PORT
entry in the OrbixWeb configuration file.
orbixd
is the internet port number 1570. If using the Orbix protocol, it is important that OrbixWeb client programmers correctly configure the port number on which the client attempts to contact an OrbixWeb daemon process, as described in section 3.2.9.
3.1.7 OrbixWeb Daemon IIOP Port
As an OrbixWeb server, the OrbixWeb daemon itself has a port on which it listens for operation invocations that use IIOP. This well known port is given by the IT_IIOP_PORT
configuration entry. The default value for this entry is 1571.
3.1.8 Server Ports
As each server is activated by the OrbixWeb daemon, it is assigned a port so that clients can communicate with it using the Orbix communications protocol. The range of port numbers chosen by the orbixd
for servers can be controlled using the configuration entries IT_DAEMON_SERVER_BASE
and IT_DAEMON_SERVER_RANGE
.IT_DAEMON_SERVER_BASE
plus 1; and the last assigned is IT_DAEMON_SERVER_BASE
plus IT_DAEMON_SERVER_RANGE
. That is, the range is:
IT_DAEMON_SERVER_BASE + 1
to
IT_DAEMON_SERVER_BASE + IT_DAEMON_SERVER_RANGE
orbixd
recycles the range in an attempt to find a free port.If no free port is found, an
IMP_LIMIT
system exception is raised to the client application attempting an invocation to the (new) server.
IT_DAEMON_SERVER_BASE
and IT_DAEMON_SERVER_RANGE
can be set using their entries in the system configuration file, or by setting the corresponding environment variables. IT_DAEMON_SERVER_BASE
must be set; IT_DAEMON_SERVER_RANGE
has a default value if not set.
IT_LOCAL_DOMAIN
configuration entry.An example is:
IT_LOCAL_DOMAIN iona.comA value for this entry is not always requiredhowever, it is advisable to provide one. It is required if both the full name (for example,
alpha.iona.com
) and abbreviated name (for example, alpha
) for a host are used. OrbixWeb must know that these are the same hostand it can only recognise this if it knows the local domain name.
The
IT_CONNECT_ATTEMPTS
configuration entry may be used to control the maximum number of retries. Note that the maximum number of retries may also be set by calling the method maxConnectRetries()
on the _CORBA.Orbix
object.The order for determining the number of retries is:
maxConnectRetries()
. The IT_CONNECT_ATTEMPTS
value will only be used if this is set to 0
.
IT_CONNECT_ATTEMPTS
.
IT_CONNECT_ATTEMPTS
entry in the OrbixWeb configuration file.
COMM_FAILURE
system exception is raised (to the client application) if the server cannot be contacted within the maximum number of retries.
-u
switch, clients may invoke on the server even if the server is not registered in the Implementation Repository.The daemon will allow clients to invoke on the persistent server while it is available. Note, however, that no access control is enforced and there is no record of the server in the Implementation Repository.
The OrbixWeb daemon would normally obtain information on which communications protocol and data encoder should be used from the Implementation Repository entry for the server. An alternative means of finding this information must be provided when a server is unregistered.
The default low-level communications protocol is given by the
IT_DEFAULT_COMMS
entry in the system configuration file.The default data encoder is given by the
IT_DEFAULT_CODE
entry.The order of searching for communications and encoding information for a persistent server is thus:
-u
switch (and there is no entry for the server in the Implementation Repository):
IT_DEFAULT_COMMS
and IT_DEFAULT_CODE
.
IT_DEFAULT_COMMS
and IT_DEFAULT_CODE
entries in the OrbixWeb configuration file.
Configure
(in package IE.Iona.Orbix2
), assigns default values to several important variables in the configuration of OrbixWeb application programs. These variables are outlined in Table 3.1 and described in subsequent subsections.
3.2.1 Communications Protocol for Binding
The variable _CORBA.IT_BIND_USING_IIOP
specifies whether IIOP is to be used as the communications protocol when calling _bind()
in an OrbixWeb application. If this variable is assigned the value true
, then the application may bind to object using IIOP, to obtain an interoperable object reference for a target object. If this variable is assigned the value false
, then the application may bind to objects using the Orbix communications protocol. The default setting is true
.3.2.2 Buffer Size for Parameter Marshalling
During operation invocations, OrbixWeb marshals operation parameters in accordance with the required communications protocol. Operation parameters are marshalled in an internal buffer, the initial size of which is specified by the _CORBA.IT_BUFFER_SIZE
variable.3.2.3 Server's Well-known Port for IIOP
The variable _CORBA.IT_IIOP_LISTEN_PORT
indicates the TCP/IP port on which an OrbixWeb server should listen for client connections using the IIOP protocol. The default value is zero, which indicates that the server should listen on a port number randomly selected by OrbixWeb. A value greater than zero indicates that the server should listen on a fixed port number._CORBA.IT_IIOP_USE_LOCATOR
is set to true
.
3.2.4 Management of Server's Well-known Port for IIOP
If _CORBA.IT_IIOP_USE_LOCATOR
is set to true
, then the OrbixWeb daemon will manage a well-known IIOP port for a server application. Otherwise, the server will not be associated with a well-known port unless _CORBA.IT_IIOP_LISTEN_PORT
is set to a non-zero value. The default value of _CORBA.IT_IIOP_USE_LOCATOR
is true
.
3.2.5 Name of the Local Internet Domain
The name of the local internet domain can be specified using the _CORBA.IT_LOCAL_DOMAIN
variable. The value of this variable has similar semantics to the OrbixWeb configuration file entry IT_LOCAL_DOMAIN
, described in section 3.1.9.
3.2.6 Naming Service Host Name
As described in Chapter 16, "Configuring OrbixWeb through its API" of OrbixWeb Programming Guide, an OrbixWeb application can get an object reference for the CORBA Naming Service by calling the method resolve_initial_references()
on the _CORBA.Orbix
object. The configuration variable _CORBA.IT_NS_HOSTNAME
specifies the name of the host on which the Naming Service is installed. By default, the application's local host name is assigned to this variable.
3.2.7 Object Table Size
All OrbixWeb objects which are instantiated in an application address space are registered in an internal object table. The object table is a hash table which maps from object identifiers to the location of objects in virtual memory. It may be important that this table is not too small for the number of objects in an application, since long overflow chains lead to inefficiencies._CORBA.IT_OBJECT_TABLE_SIZE
allows the size of the object table to be configured for each application. The default size is 100.reSizeObjectTable()
(defined in class ORB
) on the _CORBA.Orbix
object.3.2.8 Orbix Object Instantiation
The _CORBA.Orbix
object is used to communicate with and configure OrbixWeb through its API. In OrbixWeb, this object can be instantiated as one of two alternative types: type ORB
or type BOA
(where each of these is defined in the package IE.Iona.Orbix2.CORBA
). BOA
extends type ORB
, and introduces functionality necessary for the implementation of OrbixWeb servers. However, client programmers are free to instantiate the _CORBA.Orbix
object as either type. This is an advantage, as type ORB
requires the dynamic loading of a significantly reduced set of Java classes._CORBA.Orbix
object is instantiated as type BOA
. The syntax of this instantiation is illustrated in section 3.2.11.
3.2.9 OrbixWeb Daemon Port
The OrbixWeb daemon process, orbixd
, awaits connections from applications which use the Orbix communications protocol on a fixed TCP/IP port. This port is specified during configuration of the OrbixWeb daemon, using the OrbixWeb configuration file entry IT_DAEMON_PORT
. Client applications who wish to contact an orbixd
process using the Orbix protocol must be configured to use the correct port number during communications with the daemon._CORBA.IT_ORBIXD_PORT
in class Configure
allows an OrbixWeb programmer to configure the OrbixWeb daemon port value for each application. If this port value does not match the IT_DAEMON_PORT
value specified in the daemon configuration file, Orbix protocol invocations which involve communications with the daemon process will raise a COMM_FAILURE
system exception.
The default Orbix protocol port is 1570, which is the standard registered port number assigned to
orbixd
.3.2.10 OrbixWeb Daemon IIOP Port
In a similar manner to the Orbix protocol port configuration in section 3.2.9, orbixd
, awaits connections from applications which use IIOP on a fixed TCP/IP port. This port is specified using the OrbixWeb configuration file entry IT_DAEMON_IIOP_PORT
. Client applications who wish to contact an orbixd
process using IIOP must be configured to use the port number specified by IT_DAEMON_IIOP_PORT
during communications with the daemon.
The variable
_CORBA.IT_ORBIXD_IIOP_PORT
in class Configure
allows an OrbixWeb programmer to configure the OrbixWeb daemon IIOP port value for each application. If this port value does not match the IT_DAEMON_IIOP_PORT
value specified in the daemon configuration file, IIOP invocations which involve communications with the daemon process will raise a COMM_FAILURE
system exception.
The default daemon IIOP port is 1571.
3.2.11 Configure.java: Source Code
The Java source code for class Configure
is included with each installation of OrbixWeb and is usually installed in the directory java/IE/Iona/Orbix2
, in the file Configure.java
. This code can be outlined as follows:
// Configure Class // In file Configure.java. package IE.Iona.Orbix2; public class Configure { private Configure() {} static public void loadStatics () { // Communications protocol for use // in binding. _CORBA.IT_BIND_USING_IIOP = true; // Initial allocation size for marshalling // buffers. _CORBA.IT_BUFFER_SIZE = 8192; // Server listen port for IIOP protocol. _CORBA.IT_IIOP_LISTEN_PORT = 0; // Local internet domain name. _CORBA.IT_LOCAL_DOMAIN = "..."; // Naming Service host name. _CORBA.IT_NS_HOSTNAME = _CORBA.Orbix.myHost (); // Internal object table size. _CORBA.IT_OBJECT_TABLE_SIZE = 100; // Orbix object instantiation - // programmers need not be aware of // constructor parameter values. _CORBA.Orbix = new IE.Iona.Orbix2.BOA (acceptConnections, iiopListenPort); // The alternative instantiation: // _CORBA.Orbix = new IE.Iona.Orbix2.ORB (); // Default port when communicating with // orbixd using Orbix protocol. _CORBA.IT_ORBIXD_PORT = 1570; // Default port when communicating with // orbixd using IIOP. _CORBA.IT_ORBIXD_IIOP_PORT = 1571; }; }Class
Configure
also includes several additional member variables which are not currently significant in the context of OrbixWeb application configuration.In order to update any of the variables described above, this class definition can simply be edited appropriately. The resulting Java source code should be compiled and the resulting bytecode output (
IE/Iona/Orbix2/Configure.class
) made available to the client at runtime, in preference to the default class.If several clients wish to load different versions of class
Configure
at runtime, then programmers should be careful to ensure that each client locates the required version, for example by using different CLASSPATH
environment settings for each. If only a single version of class Configure
is required for all clients, then the programmer may chose to overwrite the default Configure.class
file in the OrbixWeb classes
directory.
orbixd
, takes the following switches:
_bind()
does not specify a host name, and it can also be used explicitly. The default locator uses specific location files to search for a particular server. These files are:
The directory containing the files
Orbix.hosts
and Orbix.hostgroups
is searched for in the following order:
IT_LOCATOR_PATH
.
IT_LOCATOR_PATH
entry in the OrbixWeb configuration file.
/etc
directory; that is /etc/Orbix.hosts
and/etc/Orbix.hostgroups
.
Orbix.hosts
and Orbix.hostgroups
files are located by the daemon using the above rules; the files are not located by your OrbixWeb client and server processes, so their settings of IT_LOCATOR_PATH
are ignored. Also, the default locator can only be invoked if an OrbixWeb daemon process is running on the client host. Note that when the locator is automatically called by
_bind()
, OrbixWeb iterates through the returned list of hosts trying each in turn to find a host which is currently available to run the server. The locator functionality is described in detail in Chapter 24, "Locators" of the OrbixWeb Programming Guide.
Using OrbixWeb, the two configuration files can be maintained by simply editing them as normal files.
3.4.1 Configuring the Locator by Editing the Configuration Files
The main entries for the default locator are held in the server location file (see Table 3.2).
Each line of this file contains the fields:
<server name>:<list hosts>:<list host groups>The fields are separated by `
:
' (colon). No white space is allowed between or within the fields. Either of the last two fields can be null (but the two `:
' characters are still required); both being null is equivalent to a null entry. The fields are interpreted as follows:Only one entry is allowed in this file for any given server name.
Example entries are:
bank:alpha,beta,gamma: spreadsheet:alpha,beta:financial mail::allThere is one special entry in the server location file: the server name
IT_daemon
. The entry for this indicates the (single) machine to contact in the case that no entry can be found for a particular server. If an entry for a required server cannot be found in the server location file of the caller, then OrbixWeb will forward the search to the host entered under IT_daemon
. That host will use its locator (its version of the server location file) to locate the required server; perhaps passing the search to yet another host.One possible use of this is to have the
IT_daemon
entries for a set of machines arranged in a circleso that all of the machines will be searched. For example, the entry for this on host alpha
could be:
IT_daemon:beta:and on host
beta
it could be:
IT_daemon:alpha:The default locator limits the number of hops that it makes in attempting to resolve a server name. Hence a circular dependency between host files, as suggested above, does not cause a difficulty.
Hosts can be gathered into groups to ease their management: in particular, group names can be specified as the last field of an entry in the locator's table. Groups are defined in the hostgroups definition file (see Table 3.2).
Each line of this file must have the format
<group name>:<list hosts>:Note the terminating "
:
" character.An example file is:
financial:gamma,delta: all:alpha,beta,gamma,delta:
serverhosts
, grouphosts
and servergroups
are provided to maintain the configuration files.
serverhosts
command accesses the server location file (see Table 3.2) and can:
serverhosts servername [-h <hostname>] [-v] [-r <hostlist>] [-a <hostlist>] [-l]Note that because of the host lists, the
servername
argument comes immediately after the command name, not after the switches.The options are as follows:
The
-h
switch is used to specify the host of the OrbixWeb daemon to send the request to; it defaults to the local host.If more than one of the switches
-r
, -a
and -l
is specified, they are executed in the order
-r -a -l
servergroups
command accesses the server location file (see Table 3.2) and can:
servergroups servername [-h <hostname>] [-v] [-r <grouplist>] [-a <grouplist>] [-l]Note that because of the group lists, the
servername
argument comes immediately after the command name, not after the switches.The options are as follows:
The
-h
switch is used to specify the host of the OrbixWeb daemon to send the request to; it defaults to the local host.If more than one of the switches
-r
, -a
and -l
is specified, they are executed in the order
-r -a -l
grouphosts
command accesses the hostgroups definition file and can
grouphosts groupname [-h <hostname>] [-v] [-r <hostlist>] [-a <hostlist>] [-l]Note that because of the host lists, the
groupname
argument comes immediately after the command name, not after the switches.The options are as follows:
The
-h
switch is used to specify the host of the OrbixWeb daemon to send the request to; it defaults to the local host.If more than one of the switches
-r
, -a
and -l
is specified, they are executed in the order:
-r -a -l
IT_daemon
and its operations are explained in "IDL Interface to the OrbixWeb Daemon" in Part II of this guide.