uCosminexus Service Platform, Reception and Adapter Definition Guide

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

Appendix A.2 Custom reception development

This section describes the development of custom receptions.

Custom receptions are developed in the development environment.

Organization of this subsection
(1) File structure used in custom reception development
(2) Creating a reception process file
(3) Creating definition files
(4) Creating custom reception EAR files

(1) File structure used in custom reception development

The structure of the custom reception EAR file created in the development environment is as follows:

|- META-INF                     
| |- application.xml            ... 1.
| |- cosminexus.xml             ... 2.
| |- MANIFEST.MF                ... 3.
|- Reception process file      ... 4.
  1. Deployment descriptor for EAR file
  2. Application property file for EAR file
  3. Manifest file for EAR file
  4. Archive file of created reception processes

Do not change the structure of the custom reception EAR file. If you want to use certain definition information required to operate reception processes, define the information in a custom reception user file created for that purpose. For details on custom reception user files, see A.2(3)(d) Custom reception user file.

(2) Creating a reception process file

Developers create reception process files by archiving the implementation files of the reception process together with the necessary definition files.

Note
The resources reserved during execution of a reception process are not automatically released when the process has finished. When the system is under a heavy load, this might cause an OutOfMemoryError due to insufficient memory in the Java heap or Permanent heap area. To avoid this issue, you need to implement processing that releases resources as appropriate or performs error handling such as rollback when an OutOfMemoryError occurs.

The reception process file is described in detail below.

(a) Format of reception process file

You can select the WAR or EJB-JAR file format for a reception process file. Select the format that is appropriate for the protocol supported by the reception process.

(b) Libraries used to implement reception processes

Use the library JAR files of the APIs provided by the custom reception framework to implement reception processes. When implementing a reception process, the following JAR files must be specified in the classpath:

 
Service-Platform-installation-directory\CSC\lib\cscmsg.jar
Service-Platform-installation-directory\CSC\lib\cscmsg_urecp_custom.jar
 
(c) Processing implemented in a reception process

The following processing is implemented in a reception process:

  1. Processing that receives service component invocation requests from the service requester
  2. Processing that passes request messages to the custom reception framework
  3. Processing that returns to the service requester any response messages returned by the custom reception framework

For details on the custom reception framework APIs used during implementation, see A.3 APIs of the custom reception framework.

(d) Setting deployment descriptors

Set the deployment descriptor for the reception process file.

Set the content as appropriate for the custom reception you are defining.

(e) Creating reception process files

Create a reception process file as an archive containing the implementation files for the reception process and the necessary definition files.

The creation procedure depends on the format of the reception process file.

Do not give a reception process file a name that starts with csc. If the file name starts with csc, normal operation is not guaranteed.

(3) Creating definition files

The following four definition files are set in a custom reception:

Each file is described below.

(a) Deployment descriptor (application.xml)

Set the deployment descriptor for the custom reception EAR file.

To set the deployment descriptor, add the settings for the reception process to the template provided by Service Platform. The template file is located in the following directory:

 
Service-Platform-installation-directory\CSC\samples\urecp\application.xml
 

The table below shows which elements and values in the deployment descriptor template file are editable. Note that the DTD of the deployment descriptor is application_1_3.dtd.

Table A-3 Elements in deployment descriptor template file

Element Editable
<?xml version="1.0" encoding="UTF-8"?>
No
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
No
<!-- All Rights Reserved. Copyright (C) 2010, Hitachi, Ltd. -->
No
<application>
No
  <display-name>CSCMsgCustomServiceDelivery</display-name>
No
  <description></description>
Yes
  <module>
Yes
    <web>
Yes
      <web-uri>web-uri</web-uri>
Yes
      <context-root>context-root</context-root>
Yes
    </web>
Yes
  </module>
Yes
  <module>
Yes
    <ejb>ejb</ejb>
Yes
  </module>
Yes
  <module>
Yes
    <java>java</java>
Yes
  </module>
Yes
</application>
No

Legend:
Yes: Can be edited.
No: Cannot be edited.

(b) Application property file (cosminexus.xml)

Set the application property file for the custom reception EAR file.

To set the application property file, add the settings for the reception process to the template file provided by Service Platform. The template file is located in the following directory:

 
Service-Platform-installation-directory\CSC\samples\urecp\cosminexus.xml
 

The table below shows which elements and values in the template of the application property file are editable. Note that the DTD of the application property file is cosminexus_8_0.dtd.

Table A-4 Elements in the application property template file

Element Editable
<?xml version="1.0" encoding="UTF-8"?>
No
<!DOCTYPE cosminexus-app PUBLIC "-//Hitachi, Ltd.//DTD Cosminexus 8.0//EN" "file:///C:/Program%20Files/Hitachi/Cosminexus/CC/admin/dtds/cosminexus_8_0.dtd">
No
<!-- All Rights Reserved. Copyright (C) 2010, Hitachi, Ltd. -->
No
<cosminexus-app>
No
  <start-order>180</start-order>
No
  <ejb-jar>
No
    <module-name>cscmsg_urecp_custom.jar</module-name>
No
    <session>
No
      <ejb-name>CSCMsgCustomFwInitializerEJB</ejb-name>
No
      <maximum-sessions>0</maximum-sessions>
No
      <stateless>
No
        <pooled-instance>
No
          <minimum>1</minimum>
No
          <maximum>1</maximum>
No
        </pooled-instance>
No
      </stateless>
No
      <start-order>10</start-order>
No
    </session>
No
    <session>
No
      <ejb-name>CSCMsgCustomOperationCallerEJB</ejb-name>
No
      <maximum-sessions>0</maximum-sessions>
No
      <stateless>
No
        <pooled-instance>
No
          <minimum>0</minimum>
No
          <maximum>0</maximum>
No
        </pooled-instance>
No
      </stateless>
No
      <start-order>20</start-order>
No
      <ejb-transaction-timeout>
No
        <method>
No
          <method-name>*</method-name>
No
        </method>
No
        <transaction-timeout>0</transaction-timeout>
No
      </ejb-transaction-timeout>
No
    </session>
No
  </ejb-jar>
No
</cosminexus-app>
No

Legend:
No: Cannot be edited.

Note 1
Do not add settings for modules whose names start with csc. That is, do not specify a value starting with csc in a <module-name> element.

Note 2
Do not set a method timeout period (a <method-observation-timeout> element and an <ejb-method-observation-timeout> element).

Note 3
Set a value greater than 50 for the start/stop order (<start-order> element) of J2EE applications associated with reception processes.

(c) Manifest file (MANIFEST.MF)

You can create a manifest file (MANIFEST.MF) for the custom reception EAR file.

Note that creating a manifest file is optional.

(d) Custom reception user file

Create a custom reception user file in situations where, for example, you want to store the settings for a reception process in an external file. The reception process can use a custom reception framework API to read the custom reception user file. For details on the API used to read the custom reception user file, see A.3 APIs of the custom reception framework.

Register the custom reception user file as a self-defined file when defining the custom reception in the development environment. For details on defining custom receptions, see A.4 Custom reception definition.

(4) Creating custom reception EAR files

Use commands such as ant and jar to create a custom reception EAR file that archives the reception process file and associated definition files.