TPSVRINIT
-BEA TUXEDO system server initialization routine
LINKAGE SECTION.
01CMD-LINE.
05 ARGC PIC 9(4) COMP-5.
05 ARGV.
10 ARGS PIC X OCCURS 0 TO 9999 DEPENDING ON ARGC.
01TPSTATUS-REC
.
COPY TPSTATUS.
PROCEDURE DIVISION USINGCMD-LINE
TPSTATUS-REC
.
* User code
EXIT PROGRAM
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
(3C) 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 (e.g., 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.
TPOPEN
(), TPSVRDONE
()