Applications. RMI, RPC and events. Request reply protocol External data representation. Operating System

Similar documents
Modulo II Socket, RMI e Corba

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

5.4. Events and notifications

Chapter 5 Distributed Objects and Remote Invocation

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI

Distributed Software Systems

Distributed Systems. Communication (2) Schedule of Today. Distributed Objects. Distributed Objects and RMI. Corba IDL Example

Distributed Systems. Communication (2) Lecture Universität Karlsruhe, System Architecture Group

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

Chapter 5: Remote Invocation. Copyright 2015 Prof. Amr El-Kadi

Chapter 5: Distributed objects and remote invocation

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

Distributed Systems. 5. Remote Method Invocation

Remote Procedure Calls CS 707

JAVA RMI. Remote Method Invocation

Slides for Chapter 5: Remote Invocation

Generic architecture

Interprocess Communication

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

RMI: Design & Implementation

CORBA CASE STUDY Introduction 20.2 CORBA RMI 20.3 CORBA services 20.4 Summary

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Remote Objects and RMI

Lecture 5: RMI etc. Servant. Java Remote Method Invocation Invocation Semantics Distributed Events CDK: Chapter 5 TVS: Section 8.3

RPC and RMI. 2501ICT Nathan

CS 5523 Operating Systems: Remote Objects and RMI

Lecture 5: Object Interaction: RMI and RPC

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

Distributed Information Processing

Remote Procedure Call

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Remote Method Invocation

presentation DAD Distributed Applications Development Cristian Toma

Remote Method Invocation in Java

Last Class: Network Overview. Today: Distributed Systems

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Component-Based Software Engineering

Written by: Dave Matuszek

RMI. Remote Method Invocation. 16-Dec-16

Distributed Computing

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

RMI Example RMI. CmpE 473 Internet Programming RMI

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI

Distributed Systems. The main method of distributed object communication is with remote method invocation

Distributed Systems COMP 212. Lecture 10 Othon Michail

Remote Method Invocation

Verteilte Systeme (Distributed Systems)

Lecture 06: Distributed Object

Chapter 4: Processes. Process Concept. Process State

Communication. Communication. Distributed Systems. Networks and protocols Sockets Remote Invocation Messages Streams. Fall /10/2001 DoCS

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

CSci Introduction to Distributed Systems. Communication: RPC In Practice

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

Distributed Programming in Java. Distribution (2)

Interprocess Communication

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

IBD Intergiciels et Bases de Données

Activation of remote objects

JAVA RMI Java, summer semester

COMP 6231: Distributed System Design

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

Outline. Chapter 4 Remote Procedure Calls and Distributed Transactions. Remote Procedure Call. Distributed Transaction Processing.

Remote Method Invocation Benoît Garbinato

Remote Method Invocation. Benoît Garbinato

CS193k, Stanford Handout #12. Threads 4 / RMI

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

Course Snapshot. The Next Few Classes

Java RMI Middleware Project

4:40pm - 6:10pm (90 min)

Module 3 - Distributed Objects & Remote Invocation

Activation of remote objects

Remote Method Invocation Java RMI & Web-Services

Java and Distributed Systems

CHAPTER - 4 REMOTE COMMUNICATION

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP)

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

Figure 6.1 System layers

6 Distributed Object-Based Systems

Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Remote Invocation Vladimir Vlassov and Johan Montelius

Chapter 4 Remote Procedure Calls and Distributed Transactions

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Unit 7: RPC and Indirect Communication

Communication and Distributed Processing

RMI. (Remote Method Invocation)

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a

Remote Method Invocation

3. Remote Procedure Call

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

Chapter 5 Remote Invocation. Gandeva Bayu Satrya, ST., MT. Telematics Labz. Informatics Department Telkom

Communication and Distributed Processing

Remote Procedure Calls Layers, Problems and Variation

CC755: Distributed and Parallel Systems

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

Structured communication (Remote invocation)

Transcription:

Figure 5.1 Middleware layer Applications RMI, RPC and events Request reply protocol External data representation Middleware layers Operating System Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 1

Figure 5.2 CORBA IDL example // In file Person.idl struct Person { string name; string place; long year; } ; interface PersonList { readonly attribute string listname; void addperson(in Person p) ; void getperson(in string name, out Person p); long number(); }; Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 2

Figure 5.3 Remote and local method invocations A remote invocation B local C invocation local E invocation local invocation D remote invocation F Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 3

Figure 5.4 A remote object and its remote interface remoteobject remote interface { of m1 m2 m3 Data implementation methods m4 m5 m6 Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 4

Figure 5.5 Invocation semantics Fault tolerance measures Invocation semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Not applicable Not applicable Maybe Yes No Re-execute procedure At-least-once Yes Yes Retransmit reply At-most-once Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 5

Figure 5.6 The role of proxy and skeleton in remote method invocation object A client proxy for B Request server skeleton & dispatcher for B s class remote object B Reply Remote Communication reference module module Communication module Remote reference module Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 6

Figure 5.7 Role of client and server stub procedures in RPC client process server process Request client program client stub procedure Communication module Reply server stub procedure Communication module dispatcher service procedure Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 7

Figure 5.8 Files interface in Sun XDR const MAX = 1000; typedef int FileIdentifier; typedef int FilePointer; typedef int Length; struct Data { int length; char buffer[max]; }; struct writeargs { FileIdentifier f; FilePointer position; Data data; }; struct readargs { FileIdentifier f; FilePointer position; Length length; }; /* this figure continues on the next page */ Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 8

Figure 5.8 continued program FILEREADWRITE { version VERSION { void WRITE(writeargs)=1; 1 Data READ(readargs)=2; 2 }=2; } = 9999; Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 9

Figure 5.9 Dealing room system Dealer s computer External source Dealer s computer Dealer Dealer Information provider Dealer s computer Dealer s computer Information provider Dealer External source Dealer Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 10

Figure 5.10 Architecture for distributed event notification object of interest Event service subscriber 1. notification object of interest observer subscriber 2. notification notification object of interest observer subscriber 3. notification Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 11

Figure 5.11 Java Remote interfaces Shape and ShapeList import java.rmi.*; import java.util.vector; public interface Shape extends Remote { int getversion() throws RemoteException; GraphicalObject getallstate() throws RemoteException; 1 } public interface ShapeList extends Remote { Shape newshape(graphicalobject g) throws RemoteException; 2 Vector allshapes() throws RemoteException; int getversion() throws RemoteException; } Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 12

Figure 5.12 The Naming class of Java RMIregistry void rebind (String name, Remote obj) This method is used by a server to register the identifier of a remote object by name, as shown in Figure 5.13, line 3. void bind (String name, Remote obj) This method can alternatively be used by a server to register a remote object by name, but if the name is already bound to a remote object reference an exception is thrown. void unbind (String name, Remote obj) This method removes a binding. Remote lookup(string name) This method is used by clients to look up a remote object by name, as shown in Figure 5.15 line 1. A remote object reference is returned. String [] list() This method returns an array of Strings containing the names bound in the registry. Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 13

Figure 5.13 Java class ShapeListServer with main method import java.rmi.*; public class ShapeListServer{ public static void main(string args[]){ System.setSecurityManager(new RMISecurityManager()); try{ ShapeList ashapelist = new ShapeListServant(); 1 Naming.rebind("Shape List", ashapelist ); 2 System.out.println("ShapeList server ready"); }catch(exception e) { System.out.println("ShapeList server main " + e.getmessage());} } } Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 14

Figure 5.14 Java class ShapeListServant implements interface ShapeList import java.rmi.*; import java.rmi.server.unicastremoteobject; import java.util.vector; public class ShapeListServant extends UnicastRemoteObject implements ShapeList { private Vector thelist; // contains the list of Shapes 1 private int version; public ShapeListServant()throws RemoteException{...} public Shape newshape(graphicalobject g) throws RemoteException { 2 version++; Shape s = new ShapeServant( g, version); 3 thelist.addelement(s); return s; } public Vector allshapes()throws RemoteException{...} public int getversion() throws RemoteException {... } } Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 15

Figure 5.15 Java client of ShapeList import java.rmi.*; import java.rmi.server.*; import java.util.vector; public class ShapeListClient{ public static void main(string args[]){ System.setSecurityManager(new RMISecurityManager()); ShapeList ashapelist = null; try{ ashapelist = (ShapeList) Naming.lookup("//bruno.ShapeList"); 1 Vector slist = ashapelist.allshapes(); 2 } catch(remoteexception e) {System.out.println(e.getMessage()); }catch(exception e) {System.out.println("Client: " + e.getmessage());} } } Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 16

Figure 5.16 Classes supporting Java RMI RemoteObject RemoteServer Activatable UnicastRemoteObject <servant class> Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 17