Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Agents on the move

Bolster your client apps by adding agent mobility

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Last month we delved into the world of agents. We learned what they are and what problems they solve. We also developed the foundation for a simple agent architecture in Java. I promised that we'd build on that foundation in the coming months, and here I am, making good on that promise.

Recall that agents typically possess one or more of the following characteristics; they can be:

  • Autonomous
  • Adaptive/learning
  • Mobile
  • Persistent
  • Goal oriented
  • Communicative/collaborative
  • Flexible
  • Active/proactive


We've got a lot of ground to cover, so we'd best get started. We're going to start our agent adventure with an up-close look at agent mobility. Agent mobility provides a good starting point because the problems associated with mobile (and potentially untrustworthy) code are well-known, and robust solutions are readily available. In addition, Java (via remote method invocation -- or RMI -- and object serialization) provides prefabricated tools that make the job of moving objects easier.

Location, location, location

To better understand mobile agents and their behavior, we must first look briefly at traditional network architectures. The following figure illustrates the network behavior of a typical client/server application.

The typical client/server application communicates via requests and responses, which require a round trip trek across the network.

A client/server application typically consists of two pieces: a client piece and a server piece. Often, the client and server pieces are on separate machines and they communicate over a common network. When the client needs data or access to resources that the server provides, the client sends a request to the server over the network. The server in turn sends a response to the request. This "handshake" occurs again and again in a traditional client/server architecture. Each request/response requires a complete round trip across the network.

Now compare the client/server architecture I just described to the mobile agent architecture illustrated in the next figure.

In the mobile agent architecture, the client actually migrates to the server to make a request directly, rather than over the network.

Just as in the client/server architecture, there is a client piece and a server piece. The difference lies in how the two communicate. When the client in the mobile agent architecture needs data or access to a resource that the server provides, the client doesn't talk to the server over the network. Instead, the client actually migrates to the server's machine. Once on the server's machine, the client makes its requests of the server directly. When the entire transaction is complete, the mobile agent returns home with the results.

A mobile agent's travel habits

One distinguishing characteristic of a mobile agent architecture is (surprise, surprise) the mobility of the code. However, while this characteristic is necessary, it alone is not sufficient. That's because the idea of moving code and computation to the location of the data and resources is not unique to the mobile agent architecture. In fact, such mobility has been a feature of many commercial databases for some time. In the database world, mobile code goes by the name of a stored procedure. A stored procedure is a piece of client code that executes on the server. In some applications, the client piece of the application can dynamically upload stored procedures to the server. Once there, they can do their work and return the results of their calculations back to the client.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources
  • Find out all you can on remote method invocation including a tutorial, the specification, the API reference, tools, and release notes from Sun's RMI Web page http://www.javasoft.com/products/jdk/1.1/docs/guide/rmi/index.html
  • Get complete information on object serialization, including the specification, the API reference, tools, and release notes from Sun's Object Serialization Web page http://www.javasoft.com/products/jdk/1.1/docs/guide/serialization/index.html
  • Cetus Links provides gobs of information on mobile agents http://www.cetus-links.org/oo_mobile_agents.html
  • The Distributed Systems Group (Technical University of Vienna) includes an interesting look at mobile code, agents, and Java http://www.infosys.tuwien.ac.at/Research/Agents/
  • Check out the Centre for Advanced Learning Technologies' Information TechnologiesAgent Technologies page for everything related to agent technology http://www.insead.fr/CALT/Encyclopedia/ComputerSciences/Agents/
  • IBM Aglets SDK (formerly Aglets Workbench) is an environment for programming mobile Internet agents in Java http://www.trl.ibm.co.jp/aglets/
  • Mitsubishi's Concordia is a framework for development and management of network-efficient mobile agent applications http://www.meitca.com/HSL/Projects/Concordia/
  • JATLite is a package of programs written in Java that allow users to quickly create new software agents that communicate robustly over the Internet http://java.stanford.edu/
  • Previous How-To Java articles