Hitachi

uCosminexus Application Server System Setup and Operation Guide


L.4 Sample programs of Enterprise Bean (Timer Service)

The sample program for executing the Timer Service is stored in the following directory:

Cosminexus-installation-directory\CC\examples\ejb\timerservice

Following is the overview and execution procedure of the sample:

Organization of this subsection

(1) Overview of Enterprise Bean (Timer Service) sample programs

The following figure shows the configuration of the Timer Service sample program "TimerService":

Figure L‒30: Configuration of TimerService

[Figure]

You can use this sample program to create, list, and cancel EJB timer through the Web browser. If timeout occurs for EJB timer, a message is output to the user log.

Following is the execution example of the sample program.

Figure L‒31: Execution example of TimerService sample program

[Figure]

The sample provides the following functionalities:

(2) Execution procedure of Enterprise Bean (Timer Service) sample programs

The following procedure describes the method of executing sample programs:

(a) Compiling sample programs

Compile sample programs by using a batch file (compile.bat) provided in the sample. This batch file creates EJB-JAR file (timerservice.jar), WAR file (timerservice.war), and EAR file (timerservice.ear).

(b) Setting the J2EE server

See Appendix L.1(1) Setting the J2EE server.

(c) Customizing the J2EE server

See Appendix L.1(2) Customizing the J2EE server.

(d) Starting the J2EE server

See Appendix L.1(3) Starting the J2EE server.

(f) Executing the application

Start the browser and specify the following string in the URL:

http://Machine-name: Port-number/ContextRoot/TimerServiceServlet

When accessing the NIO HTTP server of the J2EE server directly, specify the URL as follows if using the default port:

http://localhost:8008/timerservice/TimerServiceServlet

(g) Undeploying the application

See Appendix L.1(6) Stopping and deleting the application.

(h) Stopping the J2EE server

See Appendix L.1(7) Stopping the J2EE server.