![]() |
![]() |
|
|
Step 2: Building Servers in bankapp
buildserver(1) puts together an executable server built on the BEA Tuxedo systems main(). Options identify the names of the output file, the input files provided by the application, and various libraries that permit you to run a BEA Tuxedo system application in a variety of ways.
buildserver invokes the cc command. The environment variables CC and CFLAGS can be set to name an alternative compile command and to set flags for the compile and link edit phases. The buildserver command is used in bankapp.mk to compile and build each server in the banking application. The following sections describe the six bankapp servers:
The ACCT server is derived from a file called ACCT.ec that contains the code for the OPEN_ACCT and CLOSE_ACCT functions. It is created in two steps. ACCT.ec is first compiled to an ACCT.o file, which is then specified to the buildserver command so that any compile-time errors can be identified and resolved.
Create the ACCT.o file (performed for you in bankapp.mk):
buildserver -r TUXEDO/SQL \
-s OPEN_ACCT -s CLOSE_ACCT \
-o ACCT \
-f ACCT.o -f appinit.o -f util.o
Note: The backslash in the preceding command-line entry is a documentation convention that indicates a line break for presentation purposes only. You should enter the command and options on one line.
Following is an explanation of the buildserver command-line options:
In bankapp, the function name is always the same as the name of the corresponding service so only the service names themselves need to be specified. It is our convention to spell all service names in all uppercase. For example, the OPEN_ACCT service is processed by the function OPEN_ACCT(). However, the -s option to buildserver does allow you to specify an arbitrary name for the processing function for a service within a server. Refer to the buildserver(1) reference page for details. It is also possible for an administrator to specify that only a subset of the services used to create the server with the buildserver command is to be available when the server is booted.
To summarize, the options specified on the buildserver command line used to create the ACCT server performed the following functions:
Note: The appinit.c file contains the system-supplied tpsvrinit() and tpsvrdone(). (Refer to tpservice(3c) reference pages for an explanation of how these routines are used.)
The BAL server is derived from a file called BAL.ec that contains the code for the ABAL, TBAL, ABAL_BID, and TBAL_BID functions. As with ACCT.ec, the BAL.ec is first compiled to a BAL.o file before being supplied to the buildserver command so that any compile-time errors can be identified and resolved.
Modify the buildserver command used to create the BAL server as follows.
buildserver -r TUXEDO/SQL \
-s ABAL -s TBAL -s ABAL_BID -s TBAL_BID\
-o BAL \
-f BAL.o -f appinit.o
Note: The backslash in the preceding command-line entry is a documentation convention that indicates a line break for presentation purposes only. You should enter the command and options on one line.
How to Build the BTADD Server
The BTADD server is derived from a file called BTADD.ec that contains the code for the BR_ADD and TLR_ADD functions. The BTADD.ec is compiled to a BTADD.o file before being supplied to the buildserver command.
Modify the buildserver command used to create the BTADD server as follows:
buildserver -r TUXEDO/SQL \
-s BR_ADD -s TLR_ADD \
-o BTADD \
-f BTADD.o -f appinit.o
Note: The backslash in the preceding command-line entry is a documentation convention that indicates a line break for presentation purposes only. You should enter the command and options on one line.
How to Build the TLR Server
The TLR server is derived from a file called TLR.ec that contains the code for the DEPOSIT, WITHDRAWAL, and INQUIRY functions. The TLR.ec is also compiled to a TLR.o file before being supplied to the buildserver command.
Modify the buildserver command used to create the TLR server as follows:
buildserver -r TUXEDO/SQL \
-s DEPOSIT -s WITHDRAWAL -s INQUIRY \
-o TLR \
-f TLR.o -f util.o -f -lm
Note: The backslash in the preceding command-line entry is a documentation convention that indicates a line break for presentation purposes only. You should enter the command and options on one line.
Note: In this example, the -f option is used to pass an option (-lm) to the cc command, which is invoked by buildserver. The -lm argument to -f causes the math libraries to be linked in at compile time.
(Refer to cc(1) in the UNIX System V User's Reference Manual for a complete list of compile-time options.)
How to Build the XFER Server
The XFER server is derived from a file called XFER.c that contains the code for the TRANSFER function. The XFER.c is also compiled to an XFER.o file before being supplied to the buildserver command.
Modify the buildserver command used to create the XFER server as follows:
buildserver -r TUXEDO/SQL \
-s TRANSFER \
-o XFER \
-f XFER.o -f appinit.o
Note: The backslash in the preceding command-line entry is a documentation convention that indicates a line break for presentation purposes only. You should enter the command and options on one line.
Servers Built in the bankapp.mk File
The topics on creating the bankapp servers are important to your understanding of how the buildserver command is specified. However, in actual practice you are apt to incorporate the build into a makefile; that is the way it is done in bankapp.
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|