html5-img
1 / 58

Java Mobile Agents with Aglets

Java Mobile Agents with Aglets. Wolfgang Schreiner e9902261@student.tuwien.ac.at. Chapter 1 – Introduction to Mobile Agents. What is a Software Agent?. End-User Perspective – An agent is a program that assists people and acts on their behalf

garson
Télécharger la présentation

Java Mobile Agents with Aglets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Mobile Agentswith Aglets Wolfgang Schreiner e9902261@student.tuwien.ac.at

  2. Chapter 1 – Introduction to Mobile Agents

  3. What is a Software Agent? • End-User Perspective – An agent is a program that assists people and acts on their behalf – Agents function by allowing people delegate work to them • System Perspective – An agent is a software object that is situated within an execution environment – possesses mandatory and orthogonal properties

  4. What is a Mobile Agent? • Stationary Agent – executes only on the system where it begins execution – interacts with an agent using communication mechanisms • Mobile Agent – not bound to the system where it begins execution – has the ability to transport itself from one system in a network to another

  5. Reasons for Mobile Agents • Reduce network load • Reduce network latency • Encapsulate protocols • Execute asynchronously and autonomously • Adapt dynamically • Are naturally heterogeneous • Are robust and fault-tolerant

  6. Network Computing • Client-Server Paradigm – A server locally hosts services that provide access to resources and code that implements these services. • Code-on-Demand Paradigm – no preinstalled code on the client side • Mobile Agent Paradigm – hosts are allowed a high degree of flexibility

  7. Mobile Agent Applications • Electronic Commerce • Personal assistance • Distributed information retrieval • Telecommunication network services • Workflow applications and groupware • Monitoring and notification • Parallel processing

  8. Mobile Agent Systems • Java – Aglets – Odyssey – Concordia – Voyager • Others – Agent Tcl – Ara – TACOMA

  9. Mobile Agent StandardizationMASIF • Agent management • Agent transfer • Agent and agent system names • Agent system type and location syntax

  10. Chapter 2 – Elements of aMobile Agent System

  11. Agent ...

  12. ... and Place

  13. Agent Behaviour (1) • Creation – Instantiation and identifier assignment – Initialization – Autonomous execution • Disposal – Preparing for disposal – Suspension of execution

  14. Agent Behaviour (2) • Dispatching – Suspend, serialize, encode, transfer • Receiving – Receive, decode, de-serialize, resume execution • Agent Class Transfer – Class at destination – Class at origin – Code-on-demand

  15. Communication

  16. MASIF • MAFAgentSystemInterface – agent management tasks • MAFFinderInterface – agent naming service

  17. Chapter 3 –Mobile Agents with Java

  18. Java Agents - Benefits • Platform Independence • Secure Execution • Dynamic Class Loading • Multithread Programming • Object Serialization • Reflection

  19. Java Agents - Drawbacks • Inadequate Support for Resource Control • No Protection of References • No Object Ownership of References • No Support for Preservation and Resumption of the Execution State

  20. The Aglet Model • Basic Elements – aglet, proxy, context, identifier – creation, cloning, dispatching, retraction, disposal, activation/deactivation • Aglet Event Model – clone, mobility and persistence listener • Aglet Communication Model – Message, FutureReply, ReplySet

  21. Aglet Package • class Aglet • interface AgletProxy • interface AgletContext • class Message • class FutureReply • class AgletID

  22. Chapter 4 –Anatomy of an Aglet

  23. Aglet Disposal • public final void Aglet.dispose(); • public void Aglet.onDisposing(); • Example: public class DisposalExample extends Aglet { public void onDisposing() { ... } public void run() { dispose(); } }

  24. Delegation-Based Event Model • CloneEvent, MobilityEvent, PersistencyEvent • CloneListener, MobilityListener, PersistencyListener • CloneAdapter, MobilityAdapter, PersistencyAdapter

  25. Cloning • public final Object Aglet.onClone(); • public final void Aglet.addCloneListener(CloneListener); • public final void Aglet.removeCloneListener(CloneListener); • public void CloneAdapter.onCloning(CloneEvent); • public void CloneAdapter.onClone(CloneEvent); • public void CloneAdapter.onCloned(CloneEvent);

  26. Aglet Mobility • public final void Aglet.dispatch(URL); • public final void Aglet.addMobilityListener(MobilityListener); • public final void Aglet.removeMobilityListener(MobilityListener); • public void MobilityAdapter.onDispatching(MobilityEvent); • public void MobilityAdapter.onArrival(MobilityEvent); • public void MobilityAdapter.onReverting(MobilityEvent);

  27. Persistence • public final void deactivate(long); • public final void Aglet.addPersistencyListener (PersistencyListener); • public final void Aglet.removePersistencyListener (PersistencyListener); • public void PersistencyAdapter.onDeactivating (PersistencyEvent); • public void PersistencyAdapter.onActivation (PersistencyEvent);

  28. Events • CloneEvent • MobilityEvent – public URL MobilityEvent.getLocation(); • PersistencyEvent – public long PersistencyAdapter.getDuration();

  29. Chapter 5 –Aglet Context

  30. Aglet Creation • Code and Code Base • Code Base and Class Mobility • Initialization Argument

  31. Proxy Retrieval • Proxy Iterator – public abstract Enumeration AgletContext.getAgletProxies(); • Getting a Local Proxy – public abstract AgletProxy AgletContext.getAgletProxy(AgletID); • Getting a Remote Proxy – URL as additional parameter

  32. Aglet Retraction • public abstract AgletProxy AgletContext.retractAglet(URL,AgletID); • Example: AgletID aid=proxy.getAgletID(); Proxy.dispatch(dest); getAgletContext().retractAglet(dest,aid);

  33. Context Properties • public abstract Object AgletContext.getProperty(String); • public abstract Object AgletContext.getProperty(String,Object); • public abstract void AgletContext.setProperty(String,Object);

  34. Chapter 6 –Aglet Messaging

  35. Simple Messaging • public Object AgletProxy.sendMessage(Message); • public boolean Aglet.handleMessage(Message);

  36. The Message Class • Message Creation – public Message(String [,…] ); • Receiving Messages – getArg, setArg, getKind, sameKind • Replying to Messages – public void Message.sendReply(); – public void Message.sendException(Exception);

  37. Getting the Reply

  38. Message Management • Serialized Message Handling • Message Priorities • Parallel Message Handling • Synchronized Message Handling

  39. Multicasting • public final void Aglet.subscribeMessage(String); • public final void Aglet.unsubscribeMessage(String); • public final void Aglet.unsubscribeAllMessages(); • public ReplySet AgletContext.multicastMessage(Message);

  40. Receiving Multiple Replies • public boolean ReplySet.hasMoreReplies(); • public FutureReply ReplySet.getNextFutureReply(); • public boolean ReplySet.addFutureReply(FutureReply);

  41. Chapter 7 –Aglet Collaboration

  42. Aglet Proxy • Cloning • Disposal • Dispatching • Deactivation and Activation • Aglet Information

  43. Controlling an Aglet

  44. Finding an Aglet • Search • Logging • Registration • AgletFinder – Lookup: NAME – Register: NAME & PROXY – Unregister: NAME

  45. Aglets in Parallel Execution

  46. Chapter 8 –Agent Design Patterns

  47. Design Pattern Classification • Traveling Patterns – Itinerary, Forward, Ticket • Task Patterns – Master-Slave • Interaction Patterns – Meeting, Locker, Messenger, Finder, Organized Group

  48. Chapter 9 –Inside Aglets

  49. Architectural Overview • Core Framework – Initialization and (de-)serialization – Class loading and transfer – Aglet references and garbage collection • Management Components – PersistencyManager – CacheManager – SecurityManager • Communication Layer

  50. Aglet Object Structure

More Related