How to use the HTTP MTP with JADE

Author: Ion Constantinescu (EPFL)

Date: May 31, 2001

Java platform: Sun JDK 1.2 Windows

JADE version 2.1

Since JADE 2.1, FIPA-compliant Message Transport Protocols can be plugged and activated at run-time on any JADE container. By default, the platform uses an IIOP based MTP which relies on the ORB provided with jdk1.2. However, HTTP can be used as an alternative transport. This tutorial describes how to install and use the HTTP MTP with JADE.

Installation.

In order to install HTTP the following steps must be performed:

Compiling

The default Makefile rules don't take the HTTP MTP into account. For handling the compilation process of the HTTP MTP you have to use the 'build.xml' ant-file located in the http 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 ) .

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/crimson.jar:./http/lib/http.jar jade.Boot ( for Unix )
or
java -classpath .\lib\jade.jar;.\lib\jadeTools.jar;.\lib\crimson.jar;.\http\lib\http.jar jade.Boot ( 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/xerces.jar:./http/lib/http.jar jade.Boot ( for Unix )
or
java -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -classpath .\lib\jade.jar;.\lib\jadeTools.jar;.\lib\xerces.jar;.\http\lib\http.jar jade.Boot ( for Windows )

It is possible to activate one ore more communication endpoints. There are two main ways for doing such an activation:

Configuring MTPs from the command line.

In this case the following parameter must be specified:

Configuring MTPs from the graphical management console.

Select a container from the GUI, click the right button of the mouse and a popup menu appears. Choose the Install a new MTP option and a dialog will be shown. Here the following information can be set:

For example, in order to install a new HTTP endpoint on the default local port by using the HTTP MTP, one should write jamr.jademtp.http.MessageTransportProtocol as the class name and nothing as the address. In order to use the transport on a different port or a particular interface of the current machine you could provide as the transport address a standard http url: http://mymachinename.org:8978 ( where 8978 would be the port number on which the transport will bind ).

Choosing Uninstall an MTP shows a dialog where the user can select from a list one of the currently installed MTPs and remove it from the platform.

Notes:

When activated the HTTP MTP uses by default the local port 7778. Please take into consideration that using other dedicated ports ( such as 80, 8080, etc. on a machine running a web server or a proxy server ) might result in configuration conflicts and unpredictable results.

When activating the HTTP MTP from the command line it is preferable to specify also the full transport address - preventing the binding of the server socket to addresses not accessible from outside the domain.


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