OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

1.3.2 Creating stubs

UAPs used with OpenTP1 require libraries for fulfilling inter-UAP service requests. One of these libraries is called a stub. Information about UAP service is specified in the stub. Information about the destination of communication is created in some cases.

For details on how to create stubs, see the applicable OpenTP1 Programming Reference manual.

Organization of this subsection
(1) Types of stub linked to application programs
(2) UAPs requiring a stub
(3) Stub creation procedure

(1) Types of stub linked to application programs

Stubs are linked to the server or client UAP.

(a) Stub linked to server UAP

A stub linked to the server UAP, working in cooperation with service distribution functions, makes the UAP ready to offer its service. The service distribution functions, which are called by the main function of the server UAP, are listed below.

The figure below shows a stub linked to the server UAP.

Figure 1-22 Stub linked to server UAP

[Figure]

(b) Stub linked to client UAP

A stub linked to the client UAP enables communication with a server UAP according to information specified about that server UAP. The client UAP requires a stub only when the XATMI interface is used for communication. When OpenTP1 RPCs are in use, the client UAP requires no stub.

(2) UAPs requiring a stub

Whether a UAP requires a stub depends on the type of UAP and the communication method used.

No stub is required for UAP that handles offline work because they do not contain a service function.

(3) Stub creation procedure

Before creating a stub, create a file (RPC interface definition file#) containing information about the UAP definition. Execute the stub creation command with its argument specified to identify this file. The following stub creation commands are available:

When the stub creation command is executed, a stub source file (source file in C) is created. Compile this file with the C compiler and link it to the object file of the UAP.

When an MHP is coded in ANSI C or C++ style, define DCMHP at compilation of the stub which is linked to the MHP.

When modifying the stub, create the UAP from scratch. Modify the RPC interface definition file, recreate the stub, and link it to the object file of the recompiled UAP.

#
For stubs compliant with the XATMI interface, this file is referred to as the XATMI interface definition file.

The figure below shows the stub creation procedure.

Figure 1-23 Stub creation procedure

[Figure]