Home > Store

Programming and Deploying Java™ Mobile Agents with Aglets™

Register your product to gain access to bonus material or receive a coupon.

Programming and Deploying Java™ Mobile Agents with Aglets™


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 1998
  • Dimensions: 7-3/8" x 9-1/4"
  • Pages: 256
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-32582-9
  • ISBN-13: 978-0-201-32582-9

The next huge wave of Internet development, Java™ Aglets™ are lightweight mobile agents that enable the autonomous execution of programs on remote heterogeneous hosts. Because Java aglets automate many of the processes users must now perform manually, the technology is poised to transform the way many users interact with the Internet.

Written by the creators of the technology, this book gives you the knowledge and skills you need to create Java aglets using IBM's Aglets Software Development Kit. Practical in focus, the book features numerous real-world examples of Java code that illustrate concepts and demonstrate Java aglets in action.

Geared for Java programmers with no previous agent experience, the book presents a clear introduction to mobile agents that explains the basic conceptual model, agent behavior, the creation and disposal of agents, and agent transfer over a network. The appendix provides systematic, detailed coverage of the Java Aglet API describes and illustrates aglet anatomy, context, messaging, and collaboration.

Moving beyond these basics, the book also presents advanced topics, such as design patterns for creating mobile agent applications, and provides a deeper look inside the Aglets framework to help you optimize the performance of your aglets. Aglet security, a topic of critical importance for this mobile technology, is covered in depth.



Web Resources

Click below for Web Resources related to this title:
IBM's Java Aglet website

Sample Content

Table of Contents

1. Introduction to Mobile Agents.

What's a Software Agent?

What's a Mobile Agent?

Seven Good Reasons for Using Mobile Agents.

Network Computing Paradigms.

Mobile Agent Applications.

Application Example: Tabican.

Contemporary Mobile Agent Systems.

Mobile Agent Standardization: MASIF.


2. Elements of a Mobile Agent System.

Agent and Place.

Agent Behavior: Creation and Disposal.

Agent Behavior: Transfer.


MASIF: MAFAgentSystem and MAFFinder.


3. Mobile Agents with Java.

Agent Characteristics of Java: Benefits.

Agent Characteristics of Java: Drawbacks.

Mobile Java Agent: The Aglet Model.

Aglet Package.

Aglet Example: Remote File Update.


4. Anatomy of an Aglet.


Aglet Disposal.

Delegation-Based Event Model.


Aglet Mobility.



Aglet Example: Directory Listing.


5. Aglet Context.

Aglet Creation.

Proxy Retrieval.

Aglet Retraction.

Context Properties.

Aglet Example: Directory Listing.


6. Aglet Messaging.

Simple Messaging.

The Message Class.

Getting the Reply.

Message Management.

Remote Messaging.


Receiving Multiple Replies.

Aglet Example: Directory Listing.


7. Aglet Collaboration.

Aglet Proxy.

Controlling an Aglet.

Finding an Aglet.

Aglets in Parallel Execution.


8. Agent Design Patterns.

Classification of Agent Design Patterns.

The Master-Slave Pattern.

The Itinerary Pattern.

Master-Slave Revisited.


9. Inside Aglets.

Architectural Overview.

Aglet Object Structure.

Initialization and Serialization of Aglets.

Class Loading and Transfer.

Communication Layer.


10. Aglet Security

What Can Go Wrong?

Taxonomy of Attacks.

Security Services: What Is Possible and What Is Not.

When You Cannot Protect Your Agents.

When You Cannot Trust Incoming Agents.

Security Model.


Appendix: The Aglet API Documentation.

com.ibm.aglet Package.

com.ibm.aglet.event Package.


Index. 0201325829T04062001


Think of the Internet as a distributed, massively parallel supercomputer that connects information repositories, databases, intelligent agents, and mobile code. Imagine sending your own personalized agents to roam the Internet. They will monitor your favorite Web sites, get you the ticket you couldnit get at the box office, or help you to remotely schedule meetings for your next overseas trip. Sound like science fiction? Maybe, but the advent of Java has truly revolutionized the Internet. It has created a global infrastructure that is just waiting for mobile agents to roam its wires and interact with millions of computers.

Who Should Read This Book? This book is about how to program mobile Internet agents in Java with the help of the Aglet application programming interface (API). A freely available implementation of the Aglet API from IBM Corporation has spurred a tremendous interest in aglets. Consequently, there have been numerous calls for a reference book on the aglet, its API, and its use. As the inventors of the aglet, we decided to put in some long nights to write the definitive book about how to program Java aglets. We hope you enjoy reading it. The book is intended for daring programmers, students, and researchers at the frontier of network programming. No particular knowledge about agent-related technologies is required, but fluency in Java is a must. .

Organization of This Book The following outline shows the progression of the material we present. Chapters 1 and 2 are a general introduction to various aspects of the mobile agent paradigm. Chapter 3 provides a bridge between the mobile agent paradigm and Java by introducing the Aglet API. Chapters 4 through 7 systematically cover the Aglet API in detail, and Chapters 8 through 10 are dedicated to advanced subjects: agent design patterns, the Aglet API and its implementation, and mobile agent security.

Chapter 1: Introduction to Mobile Agents

This chapter leads you into the world of mobile agents, an emerging technology that makes it much easier to design, implement, and maintain distributed systems. We explain the benefits of mobile agents and demonstrate their impact on the design of distributed systems. The chapter also includes a brief overview of contemporary mobile agent systems.

Chapter 2: Elements of a Mobile Agent System

This chapter helps you to develop a basic understanding of the elements of a mobile agent system. We present the basic conceptual model of mobile agents, which includes the two core concepts of any mobile agent system: agent and place. The chapter also describes the essentials of agent behavior, including the creation and disposal of agents and their transfer over a network.

Chapter 3: Mobile Agents with Java

This chapter shows what it is that makes Java a powerful tool for agent development. This chapter introduces you to the agletoa Java-based agile agentoand gives you a brief overview of the Aglet API. The purpose of this overview is to link the mobile agent model with Java.

Chapter 4: Anatomy of an Aglet

This chapter teaches you about the methods in the Aglet class that can be overridden by the programmer. These methods are systematically invoked by the system as important events in the life of an aglet. The chapter shows you the principles of using these methods, including important information about the order in which they are invoked by the system when specific events take place. With this knowledge, you will be in a position to create aglets that can perform simple tasks on remote computers.

Chapter 5: Aglet Context

This chapter covers one of the key elements of the Aglet API, namely, the AgletContext interface. The interface defines the execution context for aglets, and in this chapter we teach you about the methods that an aglet can invoke in its current context to create new aglets, retrieve aglets contained in the same as well as remote contexts, and much more.

Chapter 6: Aglet Messaging

This chapter covers the basics of aglet messaging. Several means of interaglet communication are supported in the Aglet API, and you will learn about simple messaging with and without reply, advanced message management, and multicast messaging between aglets. The classes covered in this chapter include Message, MessageManager, and FutureReply.

Chapter 7: Aglet Collaboration

This chapter introduces the aglet proxy, AgletProxy, and describes the rationale behind this important element of the Aglet API. This overview is followed by a demonstration of different ways to control aglets to make them collaborate with one another.

Chapter 8: Agent Design Patterns

This chapter focuses on a set of design patterns for creating mobile agent applications. Design patterns have proved to be highly useful in object-oriented programming and have helped developers to achieve good design of applications through reusability of validated components. We hope that the design patterns described in this chapter will serve this purpose in the context of aglet-based .

Chapter 9: Inside Aglets

This chapter presents a general overview of the components of the Aglets framework, with a special focus on selected parts of the framework. After reading this chapter you should have a sufficient understanding of the inner workings of the Aglets Framework to optimize the performance of your aglets, to understand why apparently healthy aglets are malfunctioning, and overall to better use the Aglet API in your programming. .

Chapter 10: Aglet Security

This chapter introduces you to network security technologies in general and mobile agent security in particular. We first show you what can go wrong when mobile agents are released in a network. This is followed by a taxonomy of attacks, which introduces you to some potential attacks related to mobile agents. We then briefly explain cryptography as a general basis of security before continuing with a description of the set of security services available for mobile agents. The remainder of this chapter is devoted to a description of security policies for mobile agent systems in general and the Aglets framework in particular. .

Appendix: The Aglet API Documentation

The appendix contains the API documentation of the Aglet API (limited to the aglet package).


We offer this list of works for further reading on related topics. The list is by no means exhaustive, and other excellent works exist on most of the .

Conventions Used in This Book All the code examples in the text have been compiled and run on Java Development Kit (JDK) 1.1.5 using the first release of IBMis Aglets Software Development Kit. Source code for examples in this book can be retrieved on-line from the Web sites listed in the Introduction.

A constant-width font is used for the following:

Code examples

 public class MyFirstAglet extends Aglet {     ...  }

Class, method, and variable names within the text

URLs set in italics

We have attempted to be complete and accurate throughout this book. Changes in future releases of IBMis Aglets Software Development Kit, as well as changes in future releases of JavaSoftis JDK, make it impossible to be completely accurate in all cases. We welcome your feedback about this book, especially if you spot errors or omissions. We prefer to use the Aglets mailing list (see the Introduction) as the communication channel for this book. However, if you wish to contact us directly, feel free to send your electronic mail to danny@acm.org.



Why All the Fuss about Mobile Agents? Software agents are programs that assist people and act on their behalf. Agents function by allowing people to delegate work to them. This is a very interesting concept that becomes even more attractive when the agents are no longer bound to the system where they begin execution. Mobile agents have the unique ability to transport themselves from one system in a network to another. The ability to travel allows mobile agents to move to a system that contains services with which they want to interact and then to take advantage of being in the same host or network as the service (see Figure I-1).

You will find that mobile agents reduce network traffic and provide an effective means of overcoming network latency. Whatis more, through their ability to operate asynchronously and independently of the process that created them, mobile agents help you to construct highly robust and fault-tolerant systems.

Several organizations promote standards for mobile agent systems. Two of them are the Object Management Group (OMG) and the Foundation for Intelligent and Physical Agents (FIPA). Together they represent almost 1,000 corporate members. OMG endorses the Mobile Agent System Interoperability Facility (MASIF); at the time of this writing, FIPA has called for proposals for agent mobility. We expect these standardization efforts to have a positive effect on the deployment of mobile agents in commercial systems.

What Is a Java Aglet? The aglet represents the next leap forward in the evolution of executable content on the Internet, introducing program code that can be transported along with state information. Aglets are Java objects that can move from one host on the Internet to another. That is, an aglet that executes on one host can suddenly halt execution, dispatch itself to a remote host, and resume execution there. When the aglet moves, it takes along its program code as well as its data.

The aglet is a mobile Java agent that supports the concepts of autonomous execution and dynamic routing on its itinerary. You can also think of the aglet as a generalization and extension of Java applets and servlets. Aglets are hosted by an Aglet server in a way similar to the way applets are hosted by a Web browser (see Figure I-2). The Aglet server provides an environment for aglets to execute in, and the Java virtual machine (JVM) and the Aglet security manager make it safe to receive and host aglets.

By the way, the origin of the word aglet is simple: it means "lightweight agent" in much the same way that applet means lightweight application. The term aglet is a portmanteau word combining agent and applet.

What Is the Aglet API? The Aglet API is an agent development kitoin other words, a set of Java classes and interfaces that allows you to create mobile Java agents. A research team at the IBM Tokyo Research Laboratory developed the Aglet API in Japan in response to a call for a uniform platform for mobile agents in heterogeneous environments such as the Internet. The effort was initiated by one of the authors of this book, Danny B. Lange, in early 1995 and continues under the leadership of Mitsuru Oshima.

What is new about the Aglet API is that it stretches the renowned "write once, run anywhere" capability of Java programs to apply to mobile agents. We would rephrase it to "write once, go anywhere." That is, once you have written an aglet, it will run on every machine that supports the Aglet API. You need not be concerned with the underlying hardware or operating system or with the nature of the particular implementation of the Aglet API on the host where your aglet is running. The Aglet API mirrors the applet model in Java. The goal has been to bring the flavor of mobility to the applet. We have attempted to make the Agletsi Framework an exercise in clean design, and it is our hope that applet programmers will appreciate the many ways in which the aglet model reflects the applet model.

IBMis Aglets Software Development Kit The Aglets Software Development Kit (ASDK) is an implementation of the Aglet API that can be downloaded from IBM Tokyo Research Laboratoryis Web site (www.trl.ibm.co.jp/aglets). The ASDK includes Aglet API packages, documentation, sample aglets, and the Tahiti aglet server (named after Dannyis favorite vacation spot). Tahiti is a Java application that allows the user to receive, manage, and send aglets to other computers that are running Tahiti (see Figure I-3). You should use Tahiti to run the examples presented in this book.

World Wide Web and Mailing Lists IBMis Aglets Web site can be found at www.trl.ibm.co.jp/aglets. Here you can find the latest releases and documentation of IBMis ASDK. Another important source of information is the Aglets mailing list, aglets@javalounge.com. Send a message with subscribe aglets in the message body to aglets-request@javalounge.com. If you wish to reach the Aglets Team, you should use aglets@yamato.ibm.co.jp.

Another interesting forum is the Mobility mailing list, mobility@media.mit.edu. Cofounded by Danny, this mailing list is dedicated to the discussion of mobile agent technology and applications. The last mailing list we want to mention is the much broader Agents mailing list, agents@cs.umbc.edu.

Acknowledgments As you are probably well aware, writing a book is never an effort undertaken solely by the authors who get all the credit on the cover. Many people have contributed, helped, and encouraged us in a great many ways.

First, our thanks go to the past and present members of the Aglets Team at IBM, without whom aglets would not have made it. They include, in alphabetical order, Dr. Yariv Aridor, Gunter Karjoth, Kazuya Kosaka, Yoshiaki Mima, Dr. Yuichi Nakamura, Kouichi Ono, Hideaki Tai, Kazuyuki Tsuda, and Gaku Yamamoto. Special thanks to Dr. Tsutomu Kamimura; without his unflagging support, aglets would not have seen the light of day. We would also like to thank Mike McDonald of IBM Japan for checking the wording of this book.

Many people at Addison-Wesley contributed to our project. In particular we wish to thank Betsy Hardinger, Katherine Kwack, Mary OiBrien, Laura Potter, Marilyn Rash, and Elizabeth Spainhour for their editorial and production support. We would also like to thank all the reviewers for their insights and valuable comments at various stages of the creation of this book: Michael Bursell, Paul Clements, Ross A. Finlayson, James P. Neill, and Alan Piszcz.

Most of all, we must thank our respective families. Mitsuru thanks Akiko for her tolerant support and little Yuka for slumbering peacefully during the writing of this book. Danny wishes to thank Eva, Jacob, and Yina for their tireless support and for being never-failing sources of wonderful diversion during the work of making aglets a reality and later during the writing of this book.

Have a good time with aglets!

Danny B. Lange
Cupertino, California

Mitsuru Oshima
Tokyo, Japan


Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership