Java Mobile Agents with Aglets Wolfgang Schreiner e
Java Mobile Agents with Aglets Wolfgang Schreiner e 9902261@student. tuwien. ac. at
Chapter 1 – Introduction to Mobile Agents
What is a Software Agent? l 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 l System Perspective – An agent is a software object that is situated within an execution environment – possesses mandatory and orthogonal properties
What is a Mobile Agent? l Stationary Agent – executes only on the system where it begins execution – interacts with an agent using communication mechanisms l 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
Reasons for Mobile Agents l l l l Reduce network load Reduce network latency Encapsulate protocols Execute asynchronously and autonomously Adapt dynamically Are naturally heterogeneous Are robust and fault-tolerant
Network Computing l Client-Server Paradigm – A server locally hosts services that provide access to resources and code that implements these services. l Code-on-Demand Paradigm – no preinstalled code on the client side l Mobile Agent Paradigm – hosts are allowed a high degree of flexibility
Mobile Agent Applications l l l l Electronic Commerce Personal assistance Distributed information retrieval Telecommunication network services Workflow applications and groupware Monitoring and notification Parallel processing
Mobile Agent Systems l Java – Aglets – Odyssey – Concordia – Voyager l Others – Agent Tcl – Ara – TACOMA
Mobile Agent Standardization MASIF l Agent management l Agent transfer l Agent and agent system names l Agent system type and location syntax
Chapter 2 – Elements of a Mobile Agent System
Agent. . .
. . . and Place
Agent Behaviour (1) l Creation – Instantiation and identifier assignment – Initialization – Autonomous execution l Disposal – Preparing for disposal – Suspension of execution
Agent Behaviour (2) l Dispatching – Suspend, serialize, encode, transfer l Receiving – Receive, decode, de-serialize, resume execution l Agent Class Transfer – Class at destination – Class at origin – Code-on-demand
Communication
MASIF l MAFAgent. System Interface – agent management tasks l MAFFinder Interface – agent naming service
Chapter 3 – Mobile Agents with Java
Java Agents - Benefits l Platform Independence l Secure Execution l Dynamic Class Loading l Multithread Programming l Object Serialization l Reflection
Java Agents - Drawbacks l Inadequate Support for Resource Control l No Protection of References l No Object Ownership of References l No Support for Preservation and Resumption of the Execution State
The Aglet Model l Basic Elements – aglet, proxy, context, identifier – creation, cloning, dispatching, retraction, disposal, activation/deactivation l Aglet Event Model – clone, mobility and persistence listener l Aglet Communication Model – Message, Future. Reply, Reply. Set
Aglet Package l class Aglet l interface Aglet. Proxy l interface Aglet. Context l class Message l class Future. Reply l class Aglet. ID
Chapter 4 – Anatomy of an Aglet
Aglet Disposal public final void Aglet. dispose(); l public void Aglet. on. Disposing(); l l Example: public class Disposal. Example extends Aglet { public void on. Disposing() {. . . } public void run() { dispose(); } }
Delegation-Based Event Model l Clone. Event, Mobility. Event, Persistency. Event l Clone. Listener, Mobility. Listener, Persistency. Listener l Clone. Adapter, Mobility. Adapter, Persistency. Adapter
Cloning l public final Object Aglet. on. Clone(); l public final void Aglet. add. Clone. Listener(Clone. Listener); l public final void Aglet. remove. Clone. Listener(Clone. Listener); l public void Clone. Adapter. on. Cloning(Clone. Event); public void Clone. Adapter. on. Clone(Clone. Event); l public void Clone. Adapter. on. Cloned(Clone. Event); l
Aglet Mobility l l l public final void Aglet. dispatch(URL); public final void Aglet. add. Mobility. Listener(Mobility. Listener); public final void Aglet. remove. Mobility. Listener(Mobility. Listener); public void Mobility. Adapter. on. Dispatching(Mobility. Event); public void Mobility. Adapter. on. Arrival(Mobility. Event); public void Mobility. Adapter. on. Reverting(Mobility. Event);
Persistence l l l public final void deactivate(long); public final void Aglet. add. Persistency. Listener (Persistency. Listener); public final void Aglet. remove. Persistency. Listener (Persistency. Listener); public void Persistency. Adapter. on. Deactivating (Persistency. Event); public void Persistency. Adapter. on. Activation (Persistency. Event);
Events l Clone. Event l Mobility. Event – public URL Mobility. Event. get. Location(); l Persistency. Event – public long Persistency. Adapter. get. Duration();
Chapter 5 – Aglet Context
Aglet Creation l Code and Code Base l Code Base and Class Mobility l Initialization Argument
Proxy Retrieval l Proxy Iterator – public abstract Enumeration Aglet. Context. get. Aglet. Proxies(); l Getting a Local Proxy – public abstract Aglet. Proxy Aglet. Context. get. Aglet. Proxy(Aglet. ID); l Getting a Remote Proxy – URL as additional parameter
Aglet Retraction l public abstract Aglet. Proxy Aglet. Context. retract. Aglet(URL, Aglet. ID); l Example: Aglet. ID aid=proxy. get. Aglet. ID(); Proxy. dispatch(dest); get. Aglet. Context(). retract. Aglet(dest, aid);
Context Properties l public abstract Object Aglet. Context. get. Property(String); l public abstract Object Aglet. Context. get. Property(String, Object); l public abstract void Aglet. Context. set. Property(String, Object);
Chapter 6 – Aglet Messaging
Simple Messaging public Object Aglet. Proxy. send. Message(Message); l public boolean Aglet. handle. Message(Message); l
The Message Class l Message Creation – public Message(String [, …] ); l Receiving Messages – get. Arg, set. Arg, get. Kind, same. Kind l Replying to Messages – public void Message. send. Reply(); – public void Message. send. Exception(Exception);
Getting the Reply
Message Management l Serialized Message Handling l Message Priorities l Parallel Message Handling l Synchronized Message Handling
Multicasting public final void Aglet. subscribe. Message(String); l public final void Aglet. unsubscribe. All. Messages(); l l public Reply. Set Aglet. Context. multicast. Message(Message);
Receiving Multiple Replies l public boolean Reply. Set. has. More. Replies(); l public Future. Reply. Set. get. Next. Future. Reply(); l public boolean Reply. Set. add. Future. Reply(Future. Reply);
Chapter 7 – Aglet Collaboration
Aglet Proxy l Cloning l Disposal l Dispatching l Deactivation and Activation l Aglet Information
Controlling an Aglet
Finding an Aglet l Search l Logging l Registration l Aglet. Finder – Lookup: NAME – Register: NAME & PROXY – Unregister: NAME
Aglets in Parallel Execution
Chapter 8 – Agent Design Patterns
Design Pattern Classification l Traveling Patterns – Itinerary, Forward, Ticket l Task Patterns – Master-Slave l Interaction Patterns – Meeting, Locker, Messenger, Finder, Organized Group
Chapter 9 – Inside Aglets
Architectural Overview l Core Framework – Initialization and (de-)serialization – Class loading and transfer – Aglet references and garbage collection l Management Components – Persistency. Manager – Cache. Manager – Security. Manager l Communication Layer
Aglet Object Structure
Initialization and Serialization l Initialization of Aglets – Locate aglet class, load class data, define class – Instantiate new object – Create reference Aglet. Ref, establish connection – Start execution l Serialization and Object Mobility
Class Loading and Transfer l Class Loading l Class Transfer – Archived classes – Code base classes – System classes – Others l Class Resumption and Evolution l Other Considerations of Class Mobility
Communication Layer l Communication API – MASIF l Agent Transfer Protocol – Dispatch – Retract – Fetch – Message
Chapter 10 – Aglet Security
What Can Go Wrong? l Agent Protection – Remote host threatens agent – Agent threatens another agent – Unauthorized third parties threaten agent l Host Protection – Incoming agent threatens host – Unauthorized third parties threaten host l Network protection – Incoming agent threatens the network
Taxonomy of Attacks l Passive Attacks – Eavesdropping – Traffic Analysis l Active Attacks – Illegal Access – Masquerade – Trojan Horse – Alteration – Replay – Resource Exhaustion – Repudiation
Security Services l Authentication – user, host, code, agent l Integrity l Confidentiality l Authorization l Nonrepudiation l Auditing
Security Model l Principals – Aglet, Context and Server, Network Domain l Permissions – File, Network, Window, Context, Aglet l Protections l Policy and Authority – Aglet owner, Context owner, Network owner
- Slides: 58