Scenario 1: Request for a Global Resource

In the following example scenario, a z/VM user program requests a connection to a global resource manager program that is located in the same TSAF or CS collection. First, log on the server virtual machine and invoke the global resource manager program, then the user program needs to start a conversation with the global resource manager. After establishing the conversation, the user program sends the name of a file to the global resource manager program. The global resource manager program then sends the entire contents of the file back to the user program. The user program then receives the file data and ends the conversation. Both programs use CPI Communications routines to communicate. For details on the routines shown here, refer to the CPI Communications Reference.

(A scenario for a local resource would be almost identical with the following scenario. The only difference: in the call to the Identify_Resource_Manager (XCIDRM) routine in step 1, the resource manager type would be specified as local instead of global.)
Figure 1. Global Resource Request Scenario
  User Program                            Global Resource Manager Program
     (in Requester Virtual Machine)          (in Server Virtual Machine)
  -----------------------------------     -------------------------------
 
                                          1. XCIDRM
                                          2. XCWOE
   3. CMINIT
   4. CMALLC
                                          5. If event=allocation request
                                             then CMACCP
   6. CMSST
   7. CMSEND
                                          8. if CMACCP okay then CMRCV
                                          9. CMSEND
  10. CMRCV
          .                                      .
          .                                      .
                        send/receive sequence
          .                                      .
          .                                      .
                                         11. CMRCV
  12. CMDEAL
                                         13. XCTRRM