SPECIAL OFFERS
Keep up with new releases and promotions. Sign up to hear from us.
Register your product to gain access to bonus material or receive a coupon.
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.
Click below for Web Resources related to this title:
IBM's Java Aglet website
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.
Summary.
Agent and Place.
Agent Behavior: Creation and Disposal.
Agent Behavior: Transfer.
Communication.
MASIF: MAFAgentSystem and MAFFinder.
Summary.
Agent Characteristics of Java: Benefits.
Agent Characteristics of Java: Drawbacks.
Mobile Java Agent: The Aglet Model.
Aglet Package.
Aglet Example: Remote File Update.
Summary.
Creation.
Aglet Disposal.
Delegation-Based Event Model.
Cloning.
Aglet Mobility.
Persistence.
Events.
Aglet Example: Directory Listing.
Summary.
Aglet Creation.
Proxy Retrieval.
Aglet Retraction.
Context Properties.
Aglet Example: Directory Listing.
Summary.
Simple Messaging.
The Message Class.
Getting the Reply.
Message Management.
Remote Messaging.
Multicasting.
Receiving Multiple Replies.
Aglet Example: Directory Listing.
Summary.
Aglet Proxy.
Controlling an Aglet.
Finding an Aglet.
Aglets in Parallel Execution.
Summary.
Classification of Agent Design Patterns.
The Master-Slave Pattern.
The Itinerary Pattern.
Master-Slave Revisited.
Summary.
Architectural Overview.
Aglet Object Structure.
Initialization and Serialization of Aglets.
Class Loading and Transfer.
Communication Layer.
Summary.
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.
Summary.
com.ibm.aglet Package.
com.ibm.aglet.event Package.
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.
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:
public class MyFirstAglet extends Aglet { ... }
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.
0201325829P04062001
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