REJO / ROS Raúl ACOSTA BERMEJO.

Slides:



Advertisements
Similar presentations
wwwcsif.cs.ucdavis.edu/~jacksoni
Advertisements

Message Passing Vs Distributed Objects
Agents & Mobile Agents.
Mobile Agents Mouse House Creative Technologies Mike OBrien.
COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed System Architectures.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Remote Method Invocation
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
The road to reliable, autonomous distributed systems
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
DISTRIBUTED FILE SYSTEM USING RMI
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Comparison of the RMI and the socket APIs
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Introduction to Remote Method Invocation (RMI)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
PRASHANTHI NARAYAN NETTEM.
DISTRIBUTED PROCESS IMPLEMENTAION BHAVIN KANSARA.
Distributed Process Implementation Hima Mandava. OUTLINE Logical Model Of Local And Remote Processes Application scenarios Remote Service Remote Execution.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Mobile Agents Babak Esfandiari. Types of Applications Dynamic load balancing. Dynamic service deployment. Intermittently connected systems.
Distributed Object Frameworks DCE and CORBA. Distributed Computing Environment (DCE) Architecture proposed by OSF Goal: to standardize an open UNIX envt.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
Netprog Java RMI1 Remote Method Invocation.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
January 26, Ann Wollrath Copyright 1999 Sun Microsystems, Inc., all rights reserved. Java ™ RMI Overview Ann Wollrath Senior Staff Engineer Sun Microsystems,
Java Distributed Object System
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Remote Method Invocation
What is RMI? Remote Method Invocation
DISTRIBUTED COMPUTING
Chapter 40 Remote Method Invocation
Remote method invocation (RMI)
Distribution Infrastructures
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Introducing Java.
Java Remote Method Invocation
Exceptions and networking
Presentation transcript:

REJO / ROS Raúl ACOSTA BERMEJO

Outline Motivation REJO: Mobile Agents ROS RAMA: architecture, example REJO structure Execution Model Reactive Method Implementation Mobile Agents ROS Migration Agent structure

Reactive Autonomous Mobile Agent RAMA Reactive Autonomous Mobile Agent A set of Java classes built by Navid Nikaein Sep/99, DEA RSD These classes are used to build Mobile Agents on top of the Reactive Approach. Agents are executed on a platform that offers some services, for instance group service.

Architecture Agents AgentMessage Client Group Admin. Ring Méthodes pour: faire la migration faire réagir la machine gestion du groupe AgentPlayer Agents AgentMessage . AgentWhiteBoard Graphical Interface Containers RSInterp Client AgentReac_Client Machine réactive AgentReactive_Server Group Admin. ProjectImpl Table qui gère l’Anneau Virtuel before next Ring Server AgentReactive_Server AgentReactive_Server

Example Nom Linked Obj Program Handlers package rama; import inria.meije.rc.sugarcubes.*; import java.awt.Label; public class WhiteBoardAgentCode extends AgentPrimitive { public void start(String home) try{ Instruction WhiteBoardAgent= new Cube(new JavaStringValue("WhiteBoard_Agent_" +(counter++)+home), new JavaObjectValue( new WhiteBoardAgent("WhiteBoard_Agent_"+(counter-1),home)), new Until("kill", new Seq( new Await("Migrate"), new Loop( new Until(new OrConfig( new PosConfig("Migrate"), new PosConfig("Return")), new Merge(new Seq( new Await("Return"), _migrationToHome() ) ,new Seq( _migrationCode() ) ) )) ,new JavaInstruction(){ public void execute(Link self){ ((Agent)self.javaObject()).disposeMessage(); }} … ); AgentReactive_client.currentSite.machine.add(WhiteBoardAgent); }catch(Exception e){ System.out.println("Error when sending the agent:"+e); } } Nom Linked Obj Program Handlers

Agent (Cube) = Link + Shell + Freeze Summary Drawbacks: Monolithic Architecture. Programming (style) à la SugarCubes. Naming problems Local broadcast and thus it is necessary to migrate in order to communicate Advantages: Ring Routing but this is also a drawback because of big rings & only Algorithm. Reactive Agent Model Services may be implemented as agents. Characteristics: Concurrency Interactivity Broadcast & Reactive Instructions Mobility Dynamic (agents, platform) Multi-platform Thanks to SugurCubes et Java Agent (Cube) = Link + Shell + Freeze

Motivation - 1 We would like to: Program reactive Systems à la Reactive Scripts but it is not Java, there isn’t platform, ... Have agent services: migration, naming, routing, etc. May add and remove modules from the platform to: add a synchronizer, Distributed Reactive Machines (DRM). have the group service. pick the routing algorithm. ...

Reactive Synchronous Approach Motivation - 2 L1 L2 L3 L4 L5 L6 L1’ L7 Reactive Synchronous Approach Java Mobile Agents L1  : Agent Reactive Languages in Java REJO, MARS L1’ : Reactive Languages in Java SugarCubes, Reactive Scripts, Junior L2  : Imperative Reactive Languages Esterel L3  : Declarative Reactive Languages Signal, Lustre L4  : High order Reactive Languages Library in SML [RP98] L5  : Agent Languages in Java Aglets, Concordia, Voyager. L6  : Agent Languages Messengers L7  : Agent Reactive Languages ROL [GM99]

REJO REactive Java Object REJO is an extension of Java that creates Reactive Objects, i.e. objects that have data and a mix of Java instructions and reactive instructions. The execution model is that of reactive Synchronous Model which executes the Java instructions in an atomic way. These objects may be considered as Mobiles Agents because they can migrate using a platform, called ROS, that provides the functionalities they need.

REJO structure REJO = Data + Java Code Reactive Code body import ros.kernel.*; import java.awt.*; public class rejo implements Agent { int cont; public void Methodes_1() body } public reactive rmain(String[] args) int ini=5; par{ cont=ini; Methodes_1(); until(“Preemption1” && “Preemption2”) loop{ stop;} || call Methodes_2(); public reactive Methodes_2() REJO = Data + Java Code Reactive Code

REJO instruction set gen, generate, ! ; wait, ? stop when-else atom, expr par{ b1 || b2 } loop repeat if-else gen, generate, ! wait, ? when-else until-handler currentValues local previousValues control freezable call inline try-catch print, println link scanner

Translation Examples - 1 react method( param ) Program _method_id _() { { var loc; = > obj = new _Local_Vars_Method_(); body } return Translation(body) ; } class _Local_Vars_Method_() { var loc; param;

Translation Examples - 2 i1; = > Jr.Seq( i1, Jr.Seq( i2; i2, Jr.Seq( … ; iN-1, iN ) ) ) par = > Jr.Par( { i1; i1, Jr.Par( || i2; i2, Jr.Par( … iN-1, iN ) ) ) }

Translation Examples - 3 loop { = > Jr.Loop ( body ) body } Assign: i=5; = > Jr.Atom(new Action(){ i= Var Loc ou Glo public void execute(Environment env) Arithm. Exp., etc. { Invoke: meth(); Instructions; obj.meth(); }} ) atom{ Expressions; Flow Control Structures if, for, while. }

Translation Examples - 4 repeat( Cte ){ = > Jr.Repeat( Cte , body ) body } repeat( Var ){ = > Jr.Repeat (new VarIntegerWrapper (locVar, nAtom), body body } ) The same thing for If and When instructions

Translation Examples - 5 wait "eve" + var + met() = > Jr.Await( Jr.Presence(new VarIdentifierWrapper(locVar, nAtom)) ) case nAtom: return "eve" + var + met(); wait "eve" && var = > Jr.Await ( wait var || met() Jr.And( Jr.Presence( … ),Jr.And( … ) ) wait ! "eve " Jr.Or( Jr.Presence( … ),Jr.Or( … ) ) Jr.Not( … ) )

parser.class + shell script Java Grammar Ver 1.1 Production rules of reactive instructions REJO life cycle JavaCC REJO parser *.java javac file.rejo REJOC parser.class + shell script phase 1: java parser file.java phase 2: javac file.class ROS

Reactive Object Model What is the relation between data and code? Rhum ROM SugarCubes Cube

Execution Model - High level REJO 1 REJO 2 Data Reac. Met. call Data events Java Code atom Java Code Reactive Machine add par react

Execution Model - Low level Par Reactive Machine Par Par Agent REJO rmain ReacMet 1 local Par API_kernel ros; Program method() { ~ } until call Par Par ReacMet 2 call locName() { ~ } method() { ~ } Par Atom Gen Wait

Reactive Method in REJOC v0.X Class REJO Vars Glo int y; RM(){ _RM Obj; return Program; } class _RM { Vars Loc int x; Hash table: To know the local variables and use a prefix, example Prefix=Obj.var Jr.Link  Obj Jr.Atom{ f(env) = Obj Obj.x + y }

Reactive Method in REJOC v1.1r1 Class REJO Jr.Link D  Obj Vars Glo int y; RM(){ LocVars_RM Obj; return Program; } class _RM { Vars Loc int x; actions(Env e, int i) { switch(i) { case 1: y + Obj.x Jr.Atom(Obj){ Obj.actions(Env=Obj); }

Reactive Method in REJOC v2.0r1 Class REJO Vars Glo RM(){ LocVars_RM Obj; return Program; } class LocVars_RM implements WrappersAndActions { Vars Loc int x; actions(Env e, int i) { switch(i) { case 1: x + y Jr.Par Jr.Atom(Obj, i){ Obj.actions(Env, i); }

REJO summary REJO not only makes easier the reactive programming (avoiding the utilization of parentheses) it allows programmers to: Mix the reactive model with Java variables to use them in conditions (when, wait, …) or values (if, repeat). REJO hides the utilization of wrappers. Mix the reactive model with Java instructions Arithmetic expressions & Java method invocations. Atomic execution of Java instructions. Use Reactive Methods to: Modular programming. Re-use code making invocations to reactive methods. Use local variables inside of reactive methods. In conclusion, all these elements define a Reactive Object Model that doesn’t exist in Junior. The other models defined in Java are Rhum and SugarCubes.

Agents An agent is a program that is autonomous enough to act independently even when the user or application that launched it is not available to provide guidance and handle errors. A mobile agent is an agent that can move through a heterogeneous network under its own control, migrating from host to host and interacting with other agents and resources on each, typically returning to its home site when its task is done. Advantages Bandwidth reduction Latency reduction Support for disconnected operation (network fails). Load balancing Development of applications (personalize server behavior).

Client-Server Paradigm Agent Paradigm X Get info Get X, Y Z Info Y Info X Y Z Z 6 msgs 4 msgs

Client-Server Paradigm Agent Paradigm Compression algo_B Compression algo_A get BIG file get BIG file Size_X = algo_A(BIG file) Size_Y = algo_B(BIG file) Size_X > Size_Y

Remote Reference Layer RMI - 1 Client Program Server Program Interface Implementation Remote Reference Layer Transport Layer Stubs & Skeletons

RMI - 2 1.Srv registers RO and registry reads srv codebase RO=Remote Object RO / String 5’,6’ RMI registry 1.Srv registers RO and registry reads srv codebase 2.Clt demands Refer name 3.Srv returns Refer 4. Clt searches stub code 5.Clt request stub from the srv codebase 6.URL srv returns stub class and any other class needed 7.Clt executes a methode on the RO and RO doesn’t know a parameter(class) 8. RO downloads the class using clt codebase. If it fails then it uses srv codebase Lookup(ads, name) bind(ads, obj) 2 3 1 Reference= stub RMI client RMI server 7 5 4 Search in: CLASSPATH or remote codebase bind(ads, obj) 8 6 Code server URL = http ftp file Plus firewall

Mobile Agent System Design Mobility Strong or weak Routing Address transfer or List of sites with their offered services Communication Message Passing, RMI (RPC), Publish Subscribe, Broadcast Com. Inter-group or Intra-group, Local Inter-group or Global Naming Local Name + Machine Name, Domain Name Server, Global Name Language: compiler or interpreter Portability, robustness, security, performance

Characteristics Language Communication Protocol Persistency Security Mobility Routing Mobile Agent Systm TACOMA, Ara, Agent Tcl. Ara,Aglets,Voyager,MARS,Concordia. TACOMA,Ara,Messangers(melange C) Telescript(C++),Obliq. Messangers(postcript). Agent Tcl, Aglets, MARS, Odyssey. RAMA, REJO/ROS. TACOMA, Odyssey, MARS. Odyssey, RAMA, REJO/ROS. Aglets(ATP=AgentTransferProtocol) Concordia Ara Concordia (Tamper) Ara,AgentTcl,Telescript,RAMA,Ajanta, Concordia,REJO/ROS. Tacoma,Aglets,Obliq,Messengers,Voy. RAMA Tcl/Tk: Java: C/C++: Orient Object: others: Message-passing: Broadcast: TCP/IP: RMI: Authentification: Strong: Weak: Itinerary: Ring:

Reactive Operating System ROS Reactive Operating System ROS is a system built on top of Reactive Model which executes reactive objects, REJOs. ROS architecture is similar to Distributed Operating System (DOS) architecture, micro-kernel. ROS was implemented with Junior and thus it has almost all RAMA advantages.

Architecture Reactive Operating = ROS System Applications Agents Reactive Shell Applications Agents Graphical Interface API Kernel API M i g a t o n REJO Table Reactive Operating = ROS System Migration Daemon Kernel Engine Daemon Reactive Machine

Agent structure - 1 AgentImpl2.rejo AgentImpl1.txt class REJO implements Agent { public reactive rmain(…) } AgentImpl2.rejo Data Java Method public reactive shell(…) { } public boolean migrateTo(…) public reactive reLoad() AgentImpl1.txt API_kernel ros; void setRos(API_kernel ros) {…} API_kernel getRos() {…} AgentData dataAg; AgentData getDataAg() {…} void setDataAg(AgentData da) {…} String locName() {…} String toString() {…}

Agent structure - 2 public reactive reLoad() { par setMigra(false); public reactive shell(handSusp, handResume) { Object[] obj; local("step") until( locName() + "!kill" ) par loop until( locName() + "!susp” ) loop{ gen "step"; stop;} handler{ call handSusp; stop; wait locName() + "!resume” ; call handResume; } || control("step"){ freezable( locName() + "!migra" ) call body(); wait locName() + "!migra” , obj; if( migrateTo(obj) ) gen locName() + "!kill” ; else gen locName() + "!reload” ; wait locName() + "!reload” ; run reLoad(); handler  call handTermin(); public reactive reLoad() { par setMigra(false); freezable( locName() + "!migra" ){ call handWarmUp(); call body(); } || stop; wait locName() + "!reload” ; run reLoad(); || getGroup()+”!kill” Agent structure - 2

Agent structure - 3 public boolean migrateTo(Object[] obj) { String dest="", ROSname=""; if( obj.length < 2 ) Traitement des paramètres … Program res = ros.unLoad( locName() + "!migra" ); if( res == null) setBody( res ); setMigra(true); try{ SendingThe = (MigrationServ) lookup("//"+dest+"/MigrationServAt "+ ROSname ); if( SendingThe.Agent(rejo) == 0 ) return false; }catch(Exception e) {…} } Agent structure - 3

Migration - 1 … 4 instants 1. Adding instructions: atom{send copy} gen event; 3. Freeze and removing instructions 4. Send a copy If (pbm) add else … 5. Loading instructions instant i i+1 i+2 i+3 … instant j 2. Executing the instructions: Starting the freeze 5. Re-execution 4 instants

Migration - 2 … 3 instants 1. Adding instructions: atom{send copy} 2. gen event; 5. Loading instructions 5. Re-exécution. instant i i+1 i+2 i+3 … instant j 3. Freeze and removing instructions 4. Sending a copy If (pbm) add else … 3 instants

Migration - 3 … 2 instants 1. gen “migra”, “ads”; gen “migra”, “ROSname”; 4. Re-execution 5. Loading instructions instant i i+1 i+2 … instant j 2. Freeze and removing instructions 3. Sending a copy If (pbm) run else … 2 instants

Conclusions REJO is a language that: Makes easier the reactive programming: syntax without parentheses modularity because of reactive methods Keeps Junior properties: semantics, cooperative programming, … Has an object oriented programming style: inheritance, polymorphism Offers the means to build mobile agents.

Conclusions ROS is a platform that: Executes Reactive Objects (REJOs). Allows REJOs to migrate. Shows that the Reactive Synchronous Model may be used instead of cooperative threads. Has an modular architecture analogue to that of an DOS: micro-kernel.

Future activities 1 Static Balancing? REJO generates a comb tree that is … in REWRITE … STORM To analyze the code to: Simplify the tree (if or if reactive), … To introduce Link instruction 3 types of variables … meth.var Modifications local( eve1, eve2 ) = local(eve1) local(eve2) Addings: this ( ou self), generate ads, msg, obj. Class X { int v1; reactive m() int v2; link(obj) obj.v3; }

Future activities - 2 Events as numbers gen 3; wait 5; wait "str"+*; wait *+var; wait locName()+*; wait *+"!migra"

Questions? Raul.Acosta_Bermejo@sophia.inria.fr http://www.inria.fr/mimosa/rp/ROS/