CSC 513 Programming Assignment 4
Transformation via Java Message Service

Update | Description | JBoss | Timeslot Signup System | JMS | Saxon XQuery Transformer | Deliverable | Resources

Update

Description

In this assignment, we will continue with our work in P1 and P3, extend our Project Zero timeslot signup system to interact with JMS message queues.

In our timeslot signup system, after signing up the timeslots, users may export their selections in an XML format (chang2.xsd). However, the signup system can only export to its XML format (chang.xsd). Our goal is to enable the timeslot signup system send the exported XMLs as messages to a queue (realized using the Java Messaging Service). A standalone Java application that listens to the queue transforms the message using XQuery from chang.xsd to chang2.xsd, and sends the results to another queue. The timeslot signup system retrieves the results from the queue, and shows them to the user.

The architecture of this assignment is shown above. We have to implement the green box and the yellow box. The green box is the extension of the timeslot signup system as in P1. Besides the original functionalities developed in P1, the system should be capable of (1) retrieving all occupied timeslots from the database and exporting them to the XML format (chang.xsd), (2) sending the exported XML document as a text message to a queue, and (3) retrieving the transformation resulting XML document (chang2.xsd) from another queue. For concreteness, we will use the builtin JBoss queues with names A and B, respectively.

The yellow box is a Java standalone application Saxon XQuery transformer that (1) listens to the JMS queue A, (2) transforms the message using XQuery as in P3, and (3) sends the results to JMS queue B.

We use JBoss as our JMS message queue provider. We use JBoss default message queues: queue/A as our JMS message queue for input; queue/B as our JMS message queue for output.

JBoss

Here are the instructions to setup JBoss.
  1. Download jboss-4.2.1.GA.zip and unzip it.
  2. To start JBoss application server, execute
    jboss-4.2.1.GA\bin\run
  3. Open the browser and go to the JBoss start page http://127.0.0.1:8080/ or http://localhost:8080/.
  4. If you don't see the JBoss start page, something is wrong. Check the messages JBoss output on startup or JBoss FAQ Wiki for more info.

Project Zero Timeslot Signup System

All libraries (JMS, Saxon) and config files required for JMS functionalities are here. Please include this file in Project Zero classpath.

Saxon XQuery Transformer

The Saxon XQuery Transformer should take the XQuery file as input. All libraries (JMS, Saxon) and config files required for JMS functionalities are here. Please include this file in the classpath. For example, to compile and execute the transformer.

javac -classpath lib.jar Transformer.java
java -cp lib.jar Transformer chang.xq

Here is the document of how to invoke XQuery transformation using Saxon in Java.

Java Message Service (JMS)

Deliverable

Resources

  1. Java Tutorial (if you are not familiar with Java)
  2. J2EE 1.4 Tutorial
  3. JBoss FAQ Wiki
  4. Invoking XQuery from a SAXON application

Last Update: April 9, 2008
Chung-Wei Hang (chang@ncsu.edu)