CONCORDIA AGENTS provide a useful platform for ubiquitous and efficient data access. An Agent's mobility allows it to travel to the source of data and interact efficiently with that source. The following example illustrates an Agent's ability to travel to a database server, access a database on that server, and return the results to the user.

In this example, a user located at a workstation, will send an Agent across the network to a database server. At the server, the Agent will perform a SQL query using JDBC and then return to the user to report the results. The entire process is represented in the picture below.

The code for the sample Agent is located here.

The sample Agent is contained in the class DBAccessAgent, which is derived from the class com.meitca.hsl.zonesjagents.shared.Agent. All Concordia Agents must be derived from this base class. The DBAccessAgent class contains two methods; queryDatabase and reportResults. The Agent is created by the user and begins it existence on the user's workstation. After it is constructed, the Agent travels to the machine containing the database server. Beyond deriving a class from Agent, no special action is required by the programmer to allow for this mobility.

On the server, the queryDatabase method executes. This method performs an SQL query using standard JDBC calls and places the results of that query into the itsResults member variable of the Agent. As an Agent travels around a network, the contents of its members travel with it. By placing the query results within a member variable, the programmer has done all necessary preparation for the mobility of that data.

After the queryDatabase method complete execution, the Agent travels back to the user's workstation. At this point, the reportResults methods executes and the results of the query is presented to the user. Once again, no special work is required of the programmer to achieve mobility. Network travel is a transparent process.

One more important piece of information defines how the Agent behaves, its Itinerary. The Itinerary defines where the Agent travels and what it does as it travels. An Itinerary for this Agent could look something like the following;

Location Action
dbserver queryDatabase
workstation reportResults

This Itinerary states that the Agent should first travel to the machine indicated by the name dbserver and at that machine, the method queryDatabase should execute. After queryDatabase completes, the Agent should travel to the machine indicated by the name workstation where the reportResults method of the Agent should execute. After the reportResults method completes, the Agent's work is finished, and it can be garbage collected.

When a user creates and sends an Agent, a process referred to as launching, that user can specify the Itinerary which the Agent should follow. The Itinerary can be specified either programmatically in application code or interactively by the user. An Itinerary can be specified interactively using either a command line tool or via a graphical user interface.

 

 

Concordia is developed and supported by
Mitsubishi Electric Information Technology Center America
at our
Horizon Systems Laboratory .

All information Copyright © 1997 by
Mitsubishi Electric Information Technology Center America (ITA).