How to use the XML-ACL Codec with JADE

Author: Ion Constantinescu (EPFL)

Date: March 27, 2001

Java platform: Sun JDK 1.2 Windows

JADE version 2.2

This tutorial describes how to install and use the XML-ACL Codec with JADE. This codec implements the FIPA Specifications no. 71 FIPA ACL Message Representation in XML Specification

Installation.

In order to install XML-ACL the following steps must be performed:

Compiling

The default Makefile rules don't take the XML-ACL Codec into account. For handling the compilation process of the XML-ACL Codec you have to use the 'build.xml' ant-file located in the xmlacl directory. The following rules are available:

Configuration and Usage

The current implementation has been tested with the following parsers:

Parser Name Parser Class
Crimson org.apache.crimson.parser.XMLReaderImpl
Xerces org.apache.xerces.parsers.SAXParser

The current configuration uses Crimson as the default parser. So if you don't want to make any changes you just have to download Crimson from the link provided above and make sure it is added to the classpath when starting ( either by including it into the $CLASSPATH environment variable - %CLASSPATH% under windows or by specifing it on the command line ) . Notice that the XML-ACL codec must be launched on all the JADE containers

Here is an example of how you would start the platform assuming that you copied crimson.jar from the initial distribution to the jade/lib directory) :

java -classpath ./lib/jade.jar:./lib/jadeTools.jar:./lib/iiop.jar:./lib/crimson.jar:./add-ons/xmlacl/lib/xmlacl.jar jade.Boot -aclcodec jamr.jadeacl.xml.XMLACLCodec ( for Unix )
or
java -classpath .\lib\jade.jar;.\lib\jadeTools.jar;./lib/iiop.jar;.\lib\crimson.jar;.\add-ons\xmlacl\lib\xmlacl.jar jade.Boot -aclcodec jamr.jadeacl.xml.XMLACLCodec ( for Windows )

If you want to use another parser suplementary you have to specify in the command line the system property org.xml.sax.parser as in the following example ( also assuming that you have copied xerces.jar from the initial distribution to the jade/lib directory ) :

java -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -classpath ./lib/jade.jar:./lib/jadeTools.jar:./lib/iiop.jar:./lib/xerces.jar:./add-ons/xmlacl/lib/xmlacl.jar jade.Boot -aclcodec jamr.jadeacl.xml.XMLACLCodec ( for Unix )
or
java -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -classpath .\lib\jade.jar;.\lib\jadeTools.jar;.\lib\iiop.jar;.\lib\xerces.jar;.\add-ons\xmlacl\lib\xmlacl.jar jade.Boot -aclcodec jamr.jadeacl.xml.XMLACLCodec ( for Windows )

Examples

Using XML-ACLCodec in Jade

When an agent wants to send a XML encoded message, all it has to do is to indicate this in the message envelope. For example (assuming e is the message envelope):

e.setAclRepresentation("fipa.acl.rep.xml.std");

and Jade takes care of the rest. When receiving xml encoded messages, the agent does not have to do anything, Jade is working for him.

JADE is a trademark of CSELT. JADE has been developed jointly by CSELT and the Computer Engineering Group of the University of Parma.
The XML-ACL Codec implementation was developed in the Artificial Inteligence Laboratory ( LIA ) at the Swiss Federal Institute of Technology Lausanne ( EPFL ).