CSIMPAPP is a basic sample ATMI application delivered with the Oracle Tuxedo system. While instructions are written for the Microfocus COBOL compiler, these may vary depending on your specific compiler. To find out which COBOL platforms are supported by the Oracle Tuxedo system, consult Appendix A, “Oracle Tuxedo 10.0 Platform Data Sheets,” in Installing the Oracle Tuxedo System.CSIMPAPP includes one client and one server. The server performs only one service: it accepts a string from the client and returns the same string in uppercase.This topic leads you through the procedures you must complete to develop CSIMPAPP. Figure 4‑1 summarizes this procedure.Figure 4‑1 csimpapp Development ProcessBefore you can run this tutorial, the Oracle Tuxedo ATMI client and server software must be installed so that the files and commands referred to are available. If you are responsible for installing the Oracle Tuxedo system software, refer to Installing the Oracle Tuxedo System for installation instructions. If the installation has already been done by someone else, you need to find out the pathname of the directory in which the software is installed (TUXDIR). You also need to have read and execute permissions on the directories and files in the Oracle Tuxedo system directory structure so you can copy CSIMPAPP files and execute Oracle Tuxedo system commands.After you complete this procedure, you will be able to understand the tasks clients and servers can perform, edit a configuration file for your own environment, and invoke tmadmin to check on the activity of your application. In short, you will understand the basic elements of all Oracle Tuxedo applications—client processes, server processes, and a configuration file—and you will know how to use Oracle Tuxedo system commands to manage your application.
1. Make a directory for CSIMPAPP and change the directory to it:
Note: This step is suggested so you can see the CSIMPAPP files you have at the start and the additional files you create along the way. Use the standard shell (/bin/sh) or the Korn shell; do not use csh.TUXDIR=<pathname of the BEA Tuxedo System root directory>
APPDIR=<pathname of your present working directory>
TUXCONFIG=$APPDIR/TUXCONFIG
COBDIR=<pathname of the COBOL compiler directory>
COBCPY=$TUXDIR/cobinclude
COBOPT="-C ANS85 -C ALIGN=8 -C NOIBMCOMP -C TRUNC=ANSI -C OSEXT=cbl"
CFLAGS="-I$TUXDIR/include"
PATH=$TUXDIR/bin:$APPDIR: $PATH
LD_LIBRARY_PATH=$COBDIR/coblib:${LD_LIBRARY_PATH}
export TUXDIR APPDIR TUXCONFIG UBBCONFIG COBDIR COBCPY
export COBOPT CFLAGS PATH LD_LIBRARY_PATHYou need TUXDIR and PATH to be able to access files in the Oracle Tuxedo directory structure and to execute Oracle Tuxedo commands:
•
•
• On an HP-UX platform on the HP 9000, use SHLIB_PATH instead of LD_LIBRARY_PATH. You need to set TUXCONFIG to be able to load the configuration file as shown in step 4.
3. Copy the CSIMPAPP files:cp TUXDIR/samples/atmi/CSIMPAPP/* .
• CSIMPCL.cbl—the source code for the client program.
• CSIMPSRV.cbl—the source code for the server program.
• TPSVRINIT.cbl—the source code for the server initialization program.
• UBBCSIMPLE—the text form of the configuration file for the application.
• WUBBCSIMPLE—the configuration file for the Workstation example.
• ws—a directory with .MAK files for client programs for three workstation platforms.Listing 4‑1 Source Code for CSIMPCL.cbl
The ATMI function used to send the message record to the service specified in SERVICE-NAME. TPCALL waits for a return message. STRING is one of the three basic Oracle Tuxedo record types. An argument, LEN IN TPTYPE-REC, specifies the length of the record in USER-DATA-REC. The ATMI function used to leave an application. A call to TPTERM is used to exit an application before performing a STOP RUN.
1. Run buildclient to compile the ATMI client program:
• buildclient(1) in the Oracle Tuxedo Command Reference
• TPINITIALIZE(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• TPTERM(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• TPCALL(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• USERLOG(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
1. Review the source code from the CSIMPSRV ATMI server program:Listing 4‑2 Source Code for CSIMPSRV.cbl
Routine used to start this service and to receive the service’s parameters and data. After a successful call, the RECV-STRING contains the data sent by the client. INSPECT statement
2. During server initialization (that is, before the server starts processing service requests), the Oracle Tuxedo system calls the TPSVRINIT subroutine. To familiarize yourself with TPSVRINIT, page through the source code for it.Listing 4‑3 Source Code for TPSVRINIT.cblA default is provided by the Oracle Tuxedo system that writes a message to USERLOG indicating that the server has been booted.
1. Run buildserver as follows to compile the ATMI server program.The executable file to be created is named CSIMPSRV and CSIMPSRV.cbl and TPSVRINIT.cbl are the input source files. The service being offered by the server CSIMPSRV is indicated by -s CSIMPSRV.You now have an executable module called CSIMPSRV.
• buildserver(1) in Oracle Tuxedo Command Reference
• TPSVCSTART(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• TPSVRINIT(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• TPRETURN(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference
• USERLOG(3cbl) in the Oracle Tuxedo ATMI COBOL Function ReferenceListing 4‑4 CSIMPAPP Configuration File*MACHINES
DEFAULT:
APPDIR="<Replace with the current pathname>"
TUXCONFIG="<Replace with TUXCONFIG Pathname>"
TUXDIR="<Root directory of BEA Tuxedo (not /)>"
ENVFILE="<pathname of file of environment vars>"
#Example:
# APPDIR="/home/me/simpapp"
# TUXCONFIG="/home/me/simpapp/TUXCONFIG"
# TUXDIR="/usr/tuxedo"
# ENVFILE=”/home/me/simpapp/envfile”
<Machine-name> LMID=simple
2. For each string (that is, for each string shown in italic between angle brackets), substitute an appropriate value:
• IPCKEY—use a value that will not conflict with any other users.
• TUXCONFIG—provide the full pathname of the binary TUXCONFIG file.
• TUXDIR—the full pathname of your Oracle Tuxedo system root directory.
• APPDIR—the full pathname of the directory in which you intend to boot the application; in this case, the current directory.
•
• machine-name—the machine name as returned by the uname -n command on a UNIX platform.
Note: The pathnames for TUXCONFIG and TUXDIR must be identical to those you set and exported earlier. You must specify actual pathnames; references to pathnames through environment variables (such as TUXCONFIG) are not acceptable. Do not forget to remove the angle brackets.
1. Run tmloadcf to load the configuration file:We now have a file called TUXCONFIG (a new file system under the control of the Oracle Tuxedo system).
• tmloadcf(1) in the Oracle Tuxedo Command Reference
• UBBCONFIG(5) in the File Formats, Data Descriptions, MIBs, and System Processes ReferenceExecute tmboot to bring up the application:The Bulletin Board Liaison (BBL) is the administrative process that monitors the shared memory structures in the application. CSIMPSRV is the CSIMPAPP server that runs continuously, awaiting requests.
• tmboot(1) in the Oracle Tuxedo Command ReferenceTo test CSIMPAPP, have the client submit a request:As the administrator, you can use the tmadmin command interpreter to check an application and make dynamic changes. To run tmadmin, you must set the TUXCONFIG variabletmadmin can interpret and run over 50 commands. For a complete list, see tmadmin(1) in the Oracle Tuxedo Command Reference. The following demonstrates two of the many tmadmin commands:
Note:
2. Enter the printserver(psr) command to display information about servers:
3. Enter the printservice(psc) command to display information about services:
4. Leave tmadmin by entering a q at the prompt. (You can boot and shut down the application from within tmadmin.)
• tmadmin(1) in the Oracle Tuxedo Command Reference
1. Run tmshutdown to bring down the application:
2. Check the ULOG:
•
• USERLOG(3cbl) in the Oracle Tuxedo ATMI COBOL Function Reference