BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Programming   |   Topic List   |   Previous   |   Next   |   Contents

   Programming a BEA Tuxedo Application Using COBOL

Defining the Unsolicited Message Handler

To define the unsolicited message handler, use the TPSETUNSOL(3cbl) routine with the following signature.

01 CURR-ROUTINE   PIC S9(9) COMP-5.
01 PREV-ROUTINE PIC S9(9) COMP-5.
01 TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPSETUNSOL" USING CURR-ROUTINE PREV-ROUTINE TPSTATUS-REC.

TPSETUNSOL allows a client to identify the routine that should be invoked when an unsolicited message is received by the BEA Tuxedo system libraries. Before the first call to TPSETUNSOL, any unsolicited messages received by the BEA Tuxedo system libraries on behalf of the client are logged and ignored. The method used by the system for notification and detection is determined by the application default, which can be overridden on a per-client basis. For more information, refer to TPINITIALIZE(3cbl) in the BEA Tuxedo COBOL Function Reference.

The CURR-ROUTINE parameter identifies one of 16 predefined routines that provide unsolicited message handling: eight C routines, tm_displatch1 through _tm_dispatch8, and eight COBOL routines, TMDISPATCH9 through TMDISPATCH16. (Alternatively, if you set CURR-ROUTINE to a value of 0, any unsolicited messages received by the BEA Tuxedo system libraries on behalf of the client are logged and ignored.) The C routines must conform to the parameter definition provided on TPSETUNSOL(3cbl). When a COBOL routine is used, TPGETUNSOL must be called to receive the data.

The following sample code shows how to set an unsolicited routine in a COBOL program.

Setting an Unsolicited Routine


*
* Call TPSETUNSOL - Set a COBOL unsolicited message handler
* Routine TMDISPATCH9 will be called
*
MOVE 9 to CURR-ROUTINE.
CALL "TPSETUNSOL" USING
CURR-ROUTINE
PREV-ROUTINE
TPSTATUS-REC.
IF NOT TPOK
Routine TMDISPATCH9 will receive unsolicited messages
ELSE
Process error condition