Table 3‑1 outlines the development process for Oracle Tuxedo CORBA applications.
Figure 3‑1 illustrates the process for developing Oracle Tuxedo CORBA applications.
•
|
The upper method accepts a string from the CORBA client application and converts the string to uppercase letters.
|
•
|
The lower method accepts a string from the CORBA client application and converts the string to lowercase letters.
|
Figure 3‑2 illustrates how the Simpapp sample application works.
Listing 3‑1 shows the
simple.idl file that defines the CORBA interfaces in the Simpapp sample application.
Table 3‑3 lists the files that are created by the
idl command.
If "OBB_ANSI_CPP" is defined, the standard C++ headers are included.
If "OBB_ANSI_CPP" is undefined, the old C headers are included.
•
|
The activate_object() and deactivate_object() methods (optional)
|
Within the activate_object() and
deactivate_object() methods, you write code that performs any particular steps related to activating or deactivating the object. For more information, see
Creating CORBA Server Applications in the Oracle Tuxedo online documentation.
Listing 3‑2 includes the C++ implementation of the
Simple and
SimpleFactory interfaces in the Simpapp sample application.
Listing 3‑3 includes the C++ code from the Simpapp sample application for the Server object.
|
|
|
|
|
|
|
•
|
The method TP::deactivateEnable() (C++) has been invoked on the object.
|
|
The Simple interface in the Simpapp sample application is assigned the default activation policy of method. For more information about managing object state and defining object activation policies, see
Creating CORBA Server Applications in the Oracle Tuxedo online documentation.
You include an invocation to the create_object_reference() method, specifying the Interface Repository ID of the factory’s OMG IDL interface or the object ID (OID) in string format. In addition, you can specify routing criteria.
Use the register_factory() method to register the factory with the FactoryFinder object in the Oracle Tuxedo domain. The
register_factory() method requires the object reference for the factory and a string identifier.
Listing 3‑4 includes the code from the Simpapp sample application that creates and registers a factory.
•
|
tc.SimpleFactory->id() specifies the SimpleFactory object's Interface Repository ID by extracting it from its typecode.
|
•
|
CORBA::NVList::_nil() specifies that no routing criteria are used, with the result that an object reference created for the Simple object is routed to the same group as the SimpleFactory object that created the object reference.
|
Listing 3‑5 includes C++ code that releases a server application and unregisters the factories in the CORBA server application.
The CORBA client development steps are illustrated in Listing 3‑6 which include code from the Simpapp sample application. In the Simpapp sample application, the CORBA client application uses a factory to get an object reference to the Simple object and then invokes the
to_upper() and
to_lower() methods on the Simple object.
When integrating a new XA resource manager into the Oracle Tuxedo system, the file $TUXDIR/udataobj/RM must be updated to include information about the XA resource manager. The information is used to include the correct libraries for the XA resource manager and to set up the interface between the transaction manager and the XA resource manager automatically and correctly. The format of this file is as follows:
rm_name:rm_structure_name:library_names
where rm_name is the name of the XA resource manager,
rm_structure_name is the name of the
xa_switch_t structure that defines the name of the XA resource manager, and
library_names is the list of the object files for the XA resource manager. White space (tabs and/or spaces) is allowed before and after each of the values and may be embedded within the
library_names. The colon (:) character may not be embedded within any of the values. Lines beginning with a pound sign (#) are treated as comments and are ignored.
Use the buildtms command to build a server process for the XA resource manager. The files that result from the
buildtms command need to be installed in the
$TUXDIR/bin directory.
Listing 3‑7 shows the configuration file for the Simpapp sample application.
•
|
The TUXCONFIG file, a binary version of the UBBCONFIG file created using the tmloadcf command. When the tmloadcf command is executed, the environment variable TUXCONFIG must be set to the name and directory location of the TUXCONFIG file. The tmloadcf command converts the configuration file to binary form and writes it to the location specified in the command.
|
You use the buildobjserver command to compile and link C++ server applications. The
buildobjserver command has the following format:
buildobjserver [-o servername] [
options]
In the buildobjserver command syntax:
•
|
-o servername represents the name of the server application to be generated by this command.
|
•
|
options represents the command-line options to the buildobjserver command.
|
When creating CORBA C++ client applications, use the buildobjclient command to construct a Oracle Tuxedo CORBA client application executable. The command combines the CORBA client stubs for interfaces that use static invocation, and the associated header files, with the standard Oracle Tuxedo libraries to form a CORBA client executable. For the syntax of the
buildobjclient command, see the
Oracle Tuxedo Command Reference in the Oracle Tuxedo online documentation.
Use the tmboot command to start the server processes in your Oracle Tuxedo CORBA application. The CORBA application is usually booted from the machine designated as the
MASTER in the
RESOURCES section of the
UBBCONFIG file.
For the tmboot command to find executables, the Oracle Tuxedo system processes must be located in the
$TUXDIR/bin directory. Server applications should be in
APPDIR, as specified in the configuration file.
When booting server applications, the tmboot command uses the
CLOPT,
SEQUENCE,
SRVGRP,
SRVID, and
MIN parameters from the configuration file. Server applications are booted in the order in which they appear in the configuration file.
Table 3‑6 describes the additional Oracle Tuxedo CORBA sample applications.