Aglets
Programming Mobile Agents
         in Java

   A Technology Project
                    Pat O'Connor

             http://www.ibm.com/java
       IBM United Kingdom Laboratories
  Aglets is a trademark of the IBM Corporation
Outline

Motivation

What are Aglets?

Technical Overview of the Aglets API

Potential Applications
Motivation
Making Agent Technology Real
Open and Pervasive
Freely available, Java, Standards
Real application
Ability to access external resources - DB, GUI, etc.
Internet
Internet enabled agents
User Interface
Friendly, Compelling Interface
What are Aglets?
Single uniform paradigm for distributed computing
 Asynchronous and Synchronous
 Object-passing and Message-passing
 Mobile objects and Stationary objects
 Active objects and Passive objects



  Disconnected              Asynchronous      Parallel
  operation                 execution         Execution

                       Dynamic Routing
What are Aglets?                             (cont'd)
Runtime/Development kit for Java based mobile agents
 Aglets Application Programming Interface (AAPI)

Autonomous execution
 Decides what to do, where to go, and when to do/go

Platform-independence
 Totally written in Java
 Create once, go everywhere!
Technical Overview of Aglets

AAPI and Aglets Runtime Framework

Agent Transfer Protocol Overview

Aglets Object Model

Patterns
Aglet API (AAPI)
Aglet
  Aglet
  AgletIdentifier
  Itinerary                        Message

AgletProxy          Aglet Aglet              Aglet Aglet
                          Proxy              Proxy

AgletContext

Message                           AgletContext
  Message
  FutureReply
  MessageManager
Aglets Runtime Framework
                      Aglets                      ATP
               Aglets Viewer (Tahiti)




                                                              Network
      Aglet                                    ATPRequester
                 Aglet
  Aglet                         AgletContext
              Aglet                            ATPDaemon

              Aglets-SecurityManager


                      Java VM + OS / Java OS
Agent Transfer Protocol

Simple Request-Response type Protocol for agents


         Dispatch (Agent)
                                            Aglets
         Retract (Identifier)            AgentSystem

 ATP Fetch (Resource)            ATP
Daemon                          Daemon       Other
       Message (Object)                       Other
                                         AgentSystems
                                                Other
                                          AgentSystems
                                            AgentSystems
         Respond (Object)
Life Cycle Events of an Aglet
   The aglet may be:
    Created / Cloned in a context
    Dispatched to / Retracted from a destination context
    Deactivated into / Activated from storage
    Disposed

Cloned                 Dispatched                 Disposed
            Aglet                      Aglet

                        Retract
   Created
                           Deactivated Activated
         Aglet Class
                                    2nd Storage
Aglet Object Model
   Aglets doesn't migrate a process

   Callback (Event Driven) approach
     onCreation, onArrival, etc...
The event      about to take place    After the event has taken place
Creation                              onCreation()
Clone          onCloning()            onClone()
Dispatch       onDispatching()        onArrival()
Retract        onReverting()          onArrival()
Dispose        onDisposing()
Deactivate     onDeactivating()
Activate                              onActivation()
Message                               handleMessage()
Dispatch
aglet.dispatch(url);     run()

       onDispatching()

                                 onArrival()

                                        run()
import aglet.*;
public class MyAglet extends Aglet {
  URL origin;
  public void onCreation(Object init) {
     origin = getAgletContext().getHostingURL();
  }
  public void onDispatching(URL urlb) {
     setText("ByeBye..");
  }
  public void onArrival(URL url) {
     if (url.equals(origin)) {
         setText("I'm back!");
     } else {
         doJob();
         dispatch(origin);
     }
  }
}
Aglet Object Model (cont'd)
An aglet can be persistent
  Deactivation/Activation                        Message
Communication by message passing
  Future type message passing
                                        Aglets
  Subscribe/Multicast in a context

An aglet can have multiple activities
  Multiple threads in an aglet
Patterns
   Common usage patterns for agents
         Master-Slave pattern
         Messenger pattern
         Meeting pattern
                                      Slave
         and more...                  Aglet
                                                Slave
Master                                          Aglet
Aglet
                                Messenger
                                  Aglet       Roaming
                                               Aglet
Messaging in Aglets
AgletProxy proxy = ....;
                                    boolean
Message m = new                     handleMessage(Message m) {
Message("hello");
                                      if ("hello".equals(m.kind)) {
FutureReply future =
                                           m.sendReply("");
proxy.sendMessage(m);
                                           return true;
.....
                                      }
Object reply = future.getReply();
                                      return false;
                                    }
Potential Applications....

Network system management

Database access

Auction

Shopping mall
Contact Information

Latest news, updates, tutorials, etc.:
http://www.ibm.co.jp/aglets

Public mailing list (discussions, questions, etc.):
aglets@javalounge.com

Contacting the Aglets team, Bug reports:
aglets@yamato.ibm.co.jp


             Any Questions?

Aglets

  • 1.
    Aglets Programming Mobile Agents in Java A Technology Project Pat O'Connor http://www.ibm.com/java IBM United Kingdom Laboratories Aglets is a trademark of the IBM Corporation
  • 2.
    Outline Motivation What are Aglets? TechnicalOverview of the Aglets API Potential Applications
  • 3.
    Motivation Making Agent TechnologyReal Open and Pervasive Freely available, Java, Standards Real application Ability to access external resources - DB, GUI, etc. Internet Internet enabled agents User Interface Friendly, Compelling Interface
  • 4.
    What are Aglets? Singleuniform paradigm for distributed computing Asynchronous and Synchronous Object-passing and Message-passing Mobile objects and Stationary objects Active objects and Passive objects Disconnected Asynchronous Parallel operation execution Execution Dynamic Routing
  • 5.
    What are Aglets? (cont'd) Runtime/Development kit for Java based mobile agents Aglets Application Programming Interface (AAPI) Autonomous execution Decides what to do, where to go, and when to do/go Platform-independence Totally written in Java Create once, go everywhere!
  • 6.
    Technical Overview ofAglets AAPI and Aglets Runtime Framework Agent Transfer Protocol Overview Aglets Object Model Patterns
  • 7.
    Aglet API (AAPI) Aglet Aglet AgletIdentifier Itinerary Message AgletProxy Aglet Aglet Aglet Aglet Proxy Proxy AgletContext Message AgletContext Message FutureReply MessageManager
  • 8.
    Aglets Runtime Framework Aglets ATP Aglets Viewer (Tahiti) Network Aglet ATPRequester Aglet Aglet AgletContext Aglet ATPDaemon Aglets-SecurityManager Java VM + OS / Java OS
  • 9.
    Agent Transfer Protocol SimpleRequest-Response type Protocol for agents Dispatch (Agent) Aglets Retract (Identifier) AgentSystem ATP Fetch (Resource) ATP Daemon Daemon Other Message (Object) Other AgentSystems Other AgentSystems AgentSystems Respond (Object)
  • 10.
    Life Cycle Eventsof an Aglet The aglet may be: Created / Cloned in a context Dispatched to / Retracted from a destination context Deactivated into / Activated from storage Disposed Cloned Dispatched Disposed Aglet Aglet Retract Created Deactivated Activated Aglet Class 2nd Storage
  • 11.
    Aglet Object Model Aglets doesn't migrate a process Callback (Event Driven) approach onCreation, onArrival, etc... The event about to take place After the event has taken place Creation onCreation() Clone onCloning() onClone() Dispatch onDispatching() onArrival() Retract onReverting() onArrival() Dispose onDisposing() Deactivate onDeactivating() Activate onActivation() Message handleMessage()
  • 12.
    Dispatch aglet.dispatch(url); run() onDispatching() onArrival() run()
  • 13.
    import aglet.*; public classMyAglet extends Aglet { URL origin; public void onCreation(Object init) { origin = getAgletContext().getHostingURL(); } public void onDispatching(URL urlb) { setText("ByeBye.."); } public void onArrival(URL url) { if (url.equals(origin)) { setText("I'm back!"); } else { doJob(); dispatch(origin); } } }
  • 14.
    Aglet Object Model(cont'd) An aglet can be persistent Deactivation/Activation Message Communication by message passing Future type message passing Aglets Subscribe/Multicast in a context An aglet can have multiple activities Multiple threads in an aglet
  • 15.
    Patterns Common usage patterns for agents Master-Slave pattern Messenger pattern Meeting pattern Slave and more... Aglet Slave Master Aglet Aglet Messenger Aglet Roaming Aglet
  • 16.
    Messaging in Aglets AgletProxyproxy = ....; boolean Message m = new handleMessage(Message m) { Message("hello"); if ("hello".equals(m.kind)) { FutureReply future = m.sendReply(""); proxy.sendMessage(m); return true; ..... } Object reply = future.getReply(); return false; }
  • 17.
    Potential Applications.... Network systemmanagement Database access Auction Shopping mall
  • 18.
    Contact Information Latest news,updates, tutorials, etc.: http://www.ibm.co.jp/aglets Public mailing list (discussions, questions, etc.): aglets@javalounge.com Contacting the Aglets team, Bug reports: aglets@yamato.ibm.co.jp Any Questions?