TPSVRINIT() - BEA Tuxedo system server initialization routine
05 ARGC PIC 9(4) COMP-5.
10 ARGS PIC X OCCURS 0 TO 9999 DEPENDING ON ARGC.
PROCEDURE DIVISION USING CMD-LINE TPSTATUS-REC.
* User code
The BEA Tuxedo system server abstraction calls TPSVRINIT() during its initialization. This routine is called after the program has become a server but before it handles any service requests; thus, BEA Tuxedo system communication may be performed and transactions may be defined in this routine. However, if TPSVRINIT() returns with open connections, asynchronous replies pending or while still in transaction mode, the BEA Tuxedo system will close the connections, ignore replies pending, abort the transaction, and the server will exit gracefully.
If an application does not provide this routine in a server, then the default version provided by the BEA Tuxedo system is called instead. The default TPSVRINIT() calls TPOPEN() and USERLOG() to announce that the server has successfully started.
Application-specific options can be passed into a server and processed in TPSVRINIT() (see servopts(5)). The options are passed through ARGC and ARGV. ARGC contain the number of arguments that have been passed and ARGV contains the arguments (in character format) separated by a single SPACE character. getopt() is used in a BEA Tuxedo system.
If successful TPSVRINIT(), returns [TPOK] in TP-STATUS and the service can start accepting requests. If an error occurs in TPSVRINIT, the application can cause the server to exit gracefully (and not take any service requests) by returning any value except [TPOK] in TP-STATUS.
If either TPRETURN() or TPFORWAR() are used outside of a service routine (for example, in clients, or in TPSVRINIT() or TPSVRDONE()), then these routines return having no effect.
If either TPRETURN() or TPFORWAR() are called in TPSVRINIT(), these routines simply return having no effect.
Copyright © 2000 BEA Systems, Inc. All rights reserved.