[Prev][Up][Next]

MMFR-000915-01 (draft)

5. Implementation

In this version of the Infopipe System, ISG+IRT/JIM, the following components have been implemented:

5.1 ISG: Infopipe Stub Generator

ISG is implemented in Java of 755 lines. It uses the Java implementation of XML parser, Xerces-J 1.0.3 by Apache [15], to parse XML representation of Infopipe Spec.

5.1.1 ISL: Infopipe Specification Language (Parser)

ISL is implemented in Java, too. The grammar of ISL is defined in JavaCC of 440 lines, and the main portion of the parser is generated by JavaCC. The total of the Java code is 3,336 lines.

ISL also uses Xerces-J 1.0.3 to create DOM tree by the parser for generating XML representation of Infopipe Spec.

5.2 IRT: Infopipe Runtime System (for Jabber IM)

IRT is the simple Java program of 383 lines; however, it works with many other libraries, such as Xerces-J 1.0.3, Xalan-J 1.0.1 [16] and AElfred [17]. Xerces-J is used to create DOM tree which is as the Infopipe internal data structure. An XSLT processor, Xalan-J by Apache, includes XPath processor and the sample implementation of XPath APIs for DOM; with which, the XML data look-up for the program variables of the Middle method is realized.

Another Java implementation of XML parser, AElfred, which is SAX-base, is used to take a part of XML stream for the Jabber messaging. Since the messaging stream flows over the network continuously while the connection between two clients are established, it is necessary for IRT to create a DOM tree from the part of the messaging stream. In particular, AElfred parses the incoming XML stream for Jabber messaging and takes a part of XML streams under the message tag; the part is passed to Xerces-J to create a DOM tree.

Figure 9 illustrate the hybrid approach to use both DOM and SAX; the whole tree represents the XML streams, which continues to flow, and only gray parts are passed to the XML DOM parser to create a tree.

Figure 9: Hybrid Approach to use both DOM and SAX

5.3 Jabber IM Clients

We've built two Jabber IM clients, one is for the Palm platform and the other is for Windows and other platforms wherever Java runs. The Palm client is implemented in Java as well as the Windows clients. For the code share, we employ a Java implementation of a framework for interfacing with a Jabber Server as a Jabber Client, JabberBeans 0.8.0.

5.3.1 Palm Edition in J2ME KVM/Palm

The Jabber IM client for the Palm platform is implemented in Java 2 Micro Edition (J2ME) for the Palm (J2ME KVM/Palm). J2ME is a subset of Java 2 Standard Edition (J2SE) plus some extra / modified APIs. Therefore, JabberBeans is at first ported onto J2ME KVM/Palm, and then client functions including GUI are built on top of the ported JabberBeans.

JabberBeans itself uses AElfred for XML processing; the receiving message stream is parsed by AElfred and SAX-base event handler treats each elements of the stream. In order to add the image attachment functionality, some code have been manually added to handle the added tags unlike the developing the infopipes by using ISG.

The number of lines of the original JabberBeans code is 15,164. 277 lines of it are modified and about 500 lines are newly added to build the JIM-J2ME KVM/Palm of 15,720 lines in total.

5.3.2 Windows (or wherever J2SE runs) Edition in J2SE

The Jabber IM client for Windows and other platforms wherever Java runs is implemented in Java, which is also known as J2SE. The core of the client use JabberBeans, almost of which is shared with the ported JabberBeans for J2ME KVM/Palm. For GUI, Swing is used (*4).

226 lines of the JabberBeans code are modified and 1,421 lines are newly added for GUI and the command line option handling to build the JIM-J2SE of 16,510 lines in total.

5.4 Image Converter Infopipe

We use the ISG and IRT/JIM to build the Image Converter Infopipe. The Infopipe Spec for the Image Converter Infopipe of about 10 lines in XML is the source for the ISG to generate 191 lines Java code for the Stub and templates for the Middle method. For the middle, 445 lines code are newly specified. In order to reduce the size and the number of color from the original image, Jim, which is the Java class libraries for image processing by Sun Microsystems, is used. In addition, some code to translate the image produced by Jimi to 1-bit (black and white) bitmap format was written.


(*4) For the simple GUI of JIM-J2SE, the sample program, the Image Processor, which is provided with Jimi, Java class libraries for image processing by Sun Microsystems, was referred.