COP 4610L (Spring 2004)
Operating Systems Lab (Distributed Applications in the Enterprise)
Dr. R. Lent

Programming Assignment 6
(Optional, grade will replace lowest grade 1-5)

DUE: Sunday, April 25, 12:00 PM - Noon (no extensions)

The last assignment is the development of a three tier, J2EE-based email subscription service.

The frontend of this service is a web tier. A servlet prompts the user for a name and email, and on the same page, it displays the list of previous subscribers. A working version of this program will be demonstrated in class.

The business tier consits of an EJB. The EJB keeps the list of subscribers and implements two methods: one to insert a new entry and another to return the current list of subscribers. The EJB is a stateful session bean that keeps in memory all the information.

Basic templates of the main files that you would need are provided. Files Subscr.java, SubscEJB.java, and SubscrHome.java define the remote interface, implementation, and home interface of the EJB. File myServlet.java outlines the main parts of the servlet program. Finally, index.jsp is the file that the user should initially see and the one that invokes the servlet.

Steps to complete:

1. (20 pts) Define the remote interface of the application (Subscr.java. You will need two methods: insertEntry(...), which inserts a new entry to the list and viewEntries(...), which retrieves the current list.

2. (25 pts) Implement the remote methods (SubscrEJB.java. Each entry of the list must include the name and email of the person and creation date. You may need to define an extra class to group all this information.

3. (10 pts) Before adding a new entry, search the list (by email) for an existing entry. If a previous entry exists, just ignore the request.

4. (25 pts) Implement the servlet. Note that the servlet keeps no data of the existing list of subscribers. It invokes methods of the EJB to access the list.

5. (20 pts) Compile and deploy the service in J2EE. Use web context "sol6" (so as to use URL http://localhost:8000/sol6). To deploy the service, indicate your EJB classes, servlet, and index.jsp. Attach the resulting .ear file to your submission.

6. Extra-Credit (20 pts): Implement persistency with cloudscape and replace the session EJB with an entity EJB. Use database.sql as an example on how to create the database in cloudscape. Submit a separate set of files for this E.C.

Software

JDK 1.3.1 (j2sdk-1_3_1-win.exe) [JDK 1.4.x may not work with j2ee 1.2]

J2EE SDK (j2sdkee-1_2_1-win.exe)

Cloudscape (cloudscape364.zip) [only needed for E.C.]

Template files

Instructions and comments

1. Note that you do not need TOMCAT for this assignment. J2EE comes with a web container to deploy servlets.

2. Insert appropriate comments to facilitate the grading of your work.

3. Pack (zip, rar, tar) your source files and deployment file (.ear), and submit your assignment before the due time/date via WebCT.