Click here to load reader
Upload
emsnews
View
1.574
Download
0
Embed Size (px)
Citation preview
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
MotivationMotivation
What are Aglets?What are Aglets?
Technical Overview of the Aglets API Technical Overview of the Aglets API
Potential ApplicationsPotential Applications
OutlineOutline
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
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
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!
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
Aglet API (AAPI) Aglet API (AAPI)
AgletContext
AgletAgletAgletAglet
AgletIdentifierAgletIdentifier
ItineraryItinerary
AgletProxyAgletProxy
AgletContextAgletContext
MessageMessageMessageMessage
FutureReplyFutureReply
MessageManagerMessageManager
Aglet AgletProxy
AgletAgletProxy
Message
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
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
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
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()
DispatchDispatch
run()
onDispatching()
aglet.dispatch(url);
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)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
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
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;}
Potential Applications....Potential Applications....
Network system managementNetwork system management
Database accessDatabase access
AuctionAuction
Shopping mallShopping mall
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?