L.8 Sample program of TP1 inbound linking functionality
Sample program that uses the TP1 inbound linking functionality is stored in the following directory:
Cosminexus-installation-directory\CC\examples\tp1inbound
The overview and execution procedure of the sample program is as follows:
- Organization of this subsection
(1) Overview of TP1 inbound linking functionality sample programs
The following figure shows the configuration of the TP1 inbound linking functionality sample program:
This sample program receives RPC request messages from C language based SUP of Base sample provided by TP1/Server Base. It is a Message-driven Bean program for executing a process similar to C language based SPP of Base sample and returns the execution result to the C language based SUP as a RPC reply message. The Message-driven Bean process acquires the customer information, and updates in the same way as that of C language based SPP of Base sample.
The sample program stores the customer information in a table in the memory. The following Table L-4 describes the table configuration and Table L-5 describes the contents of the table used by the sample program:
Column |
Explanation |
---|---|
name |
Name |
sex |
Sex |
age |
Age |
sale |
Sale |
name |
sex |
age |
sale |
---|---|---|---|
Suzuki |
M |
30 |
1000000 |
Okada |
F |
23 |
1500000 |
Yoshida |
F |
26 |
800000 |
Saitoh |
M |
24 |
1000000 |
Itoh |
M |
35 |
1800000 |
Nishikawa |
M |
20 |
300000 |
Katoh |
F |
28 |
1000000 |
Satoh |
F |
27 |
2100000 |
Hasegawa |
M |
25 |
600000 |
Watanabe |
M |
31 |
1600000 |
(2) Execution procedure of the sample program of TP1 inbound linking functionality
The following procedure describes the procedure for executing the sample programs.
(a) Setting the base sample of TP1/Server Base
Perform the following settings for the Base sample of TP1/Server Base.
-
Setting the scheduler direct by user service network definition
Set OpenTP1 user service definition and the user service network definition to call TP1 inbound adapter with the scheduler direct functionality by user service network definition. Set the following contents.
-
Specify TP1 inbound adapter service group name, host name and port number in the user service network definition. The following table describes the settings:
Table L‒6: Settings in user service network definition Settings
Contents to be set
Service group name
Specify the service group name "base_svg" specified in the Base sample.
Host name
Specify the host name of Application Server.#
Port number
Specify the port number defined in the scd_port property of the Connector property file of TP1 inbound adapter.
Example of user service network definition
dcsvgdef -g base_svg -h Host name[:Port number]
-
Set definition in the user service definition rpc_destination_mode. This enables you to search address from the specified value of user service network definition when you call the dc_rpc_call function.
Example of user service definition
set rpc_destination_mode = definition
For details, see the OpenTP1 Program Creation Guide.
-
-
Setting the performance analysis trace
You must set the performance analysis trace in the common system definitions; to inherit the information of OpenTP1 performance analysis trace by TP1 inbound adapter. The following table describes the settings:
Table L‒7: Settings of the performance analysis trace Settings
Purpose of setting
set prf_trace=Y
To acquire the information of trace for the performance validation.
set rpc_prf_trace_level=00010001
To transmit the OpenTP1 PRF information to Cosminexus.
For common system definitions, see the manual OpenTP1 System Definition.
(b) Compiling the sample programs
Compile the sample programs by using a batch file (compile.bat) provided in the sample. This batch file creates EAR file.
(c) Setting the J2EE server
(d) Customizing the J2EE server
(e) Starting the J2EE server
(f) Importing, setting and starting TP1 inbound adapter
For details on importing and setting the TP1 inbound adapter, see Appendix L.1(4) Setting the resource adapter. However, among the description in the reference, connection test of the resource adapter with the cjtestres command need not be executed. Message KDJE48606-E is generated on executing the connection test. In the settings of TP1 inbound adapter, specify the service group name "base_svg" specified in the Base sample, in the service_group property of the Connector property file.
(g) Deploying the application
See Appendix L.1(5) Importing, setting and starting the application.
(h) Executing SUP
See the Base sample provided by TP1/Server Base.
(i) Undeploying the application
(j) Stopping the J2EE server
(3) Notes on sample programs
This section describes the notes on using sample programs.
-
Setting a connection of TP1 inbound adapter
Ensure the proper settings for the connection of TP1 inbound adaptor to use as a resource in this sample program.
-
Resolving the link of a resource
The resource link need not be resolved if the default display name of TP1 inbound adapter is not changed. You must resolve the resource link if the default display name of TP1 inbound adapter is changed. The following procedure describes the method of resolving the link:
1. Set the display name of the resource in <message-ref> of cosminexus.xml provided in the sample.
For details on setting the display name, see 2. Cosminexus Application Property File (cosminexus.xml) in the uCosminexus Application Server Application and Resource Definition Reference Guide.
2. Deploy the application.
-
-
Platform to execute the sample program
This sample program does not create or acquire the user data that recognizes Endian. Hence, run SUP on the platform having the identical Endian. If you run SUP on a platform having different Endian, the value of "Sales" in the sample program becomes invalid.