18

Click here to load reader

Aglets

  • Upload
    emsnews

  • View
    1.574

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Aglets

AgletsAglets

Programming Mobile Agents Programming Mobile Agents in Javain Java

A Technology ProjectA Technology Project Pat O'Connor Pat O'Connor

http://www.ibm.com/java http://www.ibm.com/javaIBM United Kingdom LaboratoriesIBM United Kingdom Laboratories

Aglets is a trademark of the IBM CorporationAglets is a trademark of the IBM Corporation

Page 2: Aglets

MotivationMotivation

What are Aglets?What are Aglets?

Technical Overview of the Aglets API Technical Overview of the Aglets API

Potential ApplicationsPotential Applications

OutlineOutline

Page 3: Aglets

MotivationMotivation

Making Agent Technology RealMaking Agent Technology RealOpen and PervasiveOpen and Pervasive

Freely available, Java, StandardsFreely available, Java, Standards

Real applicationReal application

Ability to access external resources - DB, GUI, etc.Ability to access external resources - DB, GUI, etc.

InternetInternet

Internet enabled agentsInternet enabled agents

User InterfaceUser Interface

Friendly, Compelling InterfaceFriendly, Compelling Interface

Page 4: Aglets

Single uniform paradigm for distributed computingSingle uniform paradigm for distributed computingAsynchronous and SynchronousAsynchronous and Synchronous

Object-passing and Message-passingObject-passing and Message-passing

Mobile objects and Stationary objectsMobile objects and Stationary objects

Active objects and Passive objectsActive objects and Passive objects

What are Aglets? What are Aglets?

Dynamic Routing

Asynchronousexecution

ParallelExecution

Disconnectedoperation

Page 5: Aglets

What are Aglets? (cont'd)What are Aglets? (cont'd)

Runtime/Development kit for Java based mobile agentsRuntime/Development kit for Java based mobile agentsAglets Application Programming Interface (AAPI)Aglets Application Programming Interface (AAPI)

Autonomous executionAutonomous executionDecides what to do, where to go, and when to do/goDecides what to do, where to go, and when to do/go

Platform-independencePlatform-independenceTotally written in JavaTotally written in Java

Create once, Create once, gogo everywhere! everywhere!

Page 6: Aglets

Technical Overview of AgletsTechnical Overview of Aglets

AAPI and Aglets Runtime FrameworkAAPI and Aglets Runtime Framework

Agent Transfer Protocol OverviewAgent Transfer Protocol Overview

Aglets Object ModelAglets Object Model

PatternsPatterns

Page 7: Aglets

Aglet API (AAPI) Aglet API (AAPI)

AgletContext

AgletAgletAgletAglet

AgletIdentifierAgletIdentifier

ItineraryItinerary

AgletProxyAgletProxy

AgletContextAgletContext

MessageMessageMessageMessage

FutureReplyFutureReply

MessageManagerMessageManager

Aglet AgletProxy

AgletAgletProxy

Message

Page 8: Aglets

Aglets Runtime FrameworkAglets Runtime Framework

Aglets Viewer (Tahiti)

AgletContext

Aglets-SecurityManager

ATPDaemon

ATPRequesterAglet

AgletAglet

Aglet

Aglets ATP

Java VM + OS / Java OS

Net

wor

k

Page 9: Aglets

Agent Transfer Protocol Agent Transfer Protocol

ATP Daemon

Aglets AgentSystem

OtherAgentSystems

OtherAgentSystems

OtherAgentSystems

ATP Daemon

Dispatch (Agent)

Retract (Identifier)

Fetch (Resource)

Message (Object)

Respond (Object)

Simple Request-Response type Protocol for agentsSimple Request-Response type Protocol for agents

Page 10: Aglets

AgletDispatched

Retract

Life Cycle Events of an AgletLife Cycle Events of an AgletThe aglet may be:The aglet may be:

Created / Cloned in a contextCreated / Cloned in a context

Dispatched to / Retracted from a destination contextDispatched to / Retracted from a destination context

Deactivated into / Activated from storageDeactivated into / Activated from storage

DisposedDisposed

Aglet Class2nd Storage

Deactivated Activated

DisposedAglet

Created

Cloned

Page 11: Aglets

Aglet Object ModelAglet Object ModelAglets doesn't migrate a processAglets doesn't migrate a process

Callback (Event Driven) approachCallback (Event Driven) approachonCreation, onArrival, etc...onCreation, onArrival, etc...

The event about to take place After the event has taken placeCreation onCreation()Clone onCloning() onClone()Dispatch onDispatching() onArrival()Retract onReverting() onArrival()Dispose onDisposing()Deactivate onDeactivating()Activate onActivation()Message handleMessage()

Page 12: Aglets

DispatchDispatch

run()

onDispatching()

aglet.dispatch(url);

onArrival()

run()

Page 13: Aglets

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); } }}

Page 14: Aglets

Aglet Object Model (cont'd)Aglet Object Model (cont'd)

An aglet can be persistentAn aglet can be persistentDeactivation/ActivationDeactivation/Activation

Communication by message passingCommunication by message passingFuture type message passingFuture type message passing

Subscribe/Multicast in a contextSubscribe/Multicast in a context

An aglet can have multiple activitiesAn aglet can have multiple activitiesMultiple threads in an agletMultiple threads in an aglet

Aglets

Message

Page 15: Aglets

PatternsPatternsCommon usage patterns for agentsCommon usage patterns for agents

Master-Slave patternMaster-Slave pattern

Messenger patternMessenger pattern

Meeting patternMeeting pattern

and more...and more...

Master Aglet

SlaveAglet

SlaveAglet

MessengerAglet Roaming

Aglet

Page 16: Aglets

Messaging in AgletsMessaging in Aglets

AgletProxy proxy = ....;

Message m = new Message("hello");FutureReply future = proxy.sendMessage(m);.....Object reply = future.getReply();

boolean handleMessage(Message m) { if ("hello".equals(m.kind)) { m.sendReply(""); return true; } return false;}

Page 17: Aglets

Potential Applications....Potential Applications....

Network system managementNetwork system management

Database accessDatabase access

AuctionAuction

Shopping mallShopping mall

Page 18: Aglets

Contact InformationContact Information

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

Public mailing list (discussions, questions, etc.):Public mailing list (discussions, questions, etc.):[email protected]@javalounge.com

Contacting the Aglets team, Bug reports:Contacting the Aglets team, Bug reports:[email protected]@yamato.ibm.co.jp

Any Questions?