Hitachi

uCosminexus Application Server Expansion Guide


3.2.4 Processing performed for using CTM

If CTM is enabled, the processing for using CTM is performed at the following times:

The following describes the processing performed at the above times.

Organization of this subsection

(1) Processing performed at startup of a J2EE server

To start a J2EE application that is customized to use CTM, when the J2EE server is started, you must establish and initialize a connection to the CTM daemon as follows:

  1. Specify the settings for using CTM.

  2. Start the CTM daemon.

  3. Start the J2EE server.

When the J2EE server starts, it establishes and initializes a connection to the CTM daemon. Make sure that the CTM daemon is started before you start the J2EE server.

For details about the settings for using the CTM daemon, see 3.4.2 Settings in the execution environment. For details about how to start the CTM daemon and J2EE server, see 4.1.24 Starting the system (when using CUI) in the uCosminexus Application Server System Setup and Operation Guide. If Smart Composer is used to start the system, the CTM daemon is started, and then the J2EE server is started.

If establishment and initialization of a connection to the CTM daemon fails during startup of the J2EE server, startup of the J2EE server fails. In this case, correct the cause of the failure, and then restart the J2EE server.

(2) Processing performed at startup of a J2EE application

When a J2EE application is started, the J2EE server requests the CTM daemon to activate a schedule queue with the specified queue name. In response to the request, the CTM daemon activates the queue, and then executes create on the J2EE server for any business-processing programs that the CTM daemon can process. The CTM daemon executes as many create instances as the number of concurrent threads (Parallel Count) for each business-processing program that is directly called by the CTM daemon.

Each time the EJB object reference that corresponds to a business-processing program is created, the EJB object reference is returned to the CTM daemon. The CTM daemon pools the received EJB object references, and then assigns them to requests that are input to the schedule queue. Thus requests are distributed to business-processing programs via the EJB object references.

(3) Processing performed at termination of a J2EE application

When a J2EE application is terminated, first, the CTM daemon is requested to lock (de-activate) the schedule queue managed by the CTM daemon to prevent the CTM daemon from distributing new requests. After de-activating the schedule queue, the CTM daemon executes remove on the J2EE server for any business-processing programs that the CTM daemon can process. The CTM daemon executes as many remove instances as the number of concurrent threads (Parallel Count) for each business-processing program that is directly called by the CTM daemon.

After that, J2EE application termination processing is executed in the same way as when CTM is not used.

(4) Processing performed at termination of a J2EE server

When the J2EE server is terminated, the connection between the J2EE server and CTM daemon is closed.