Programming Models for Distributed Application

Slides:



Advertisements
Similar presentations
RPC Robert Grimm New York University Remote Procedure Calls.
Advertisements

Distributed Objects and Remote Invocation
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Exercises for Chapter 4: Interprocess Communication
Remote Object Invocation
Slides for Chapter 6: Operating System support From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Java RMI, JAX-RPC and JWSDP
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Communication in Distributed Systems –Part 2
.NET Mobile Application Development Remote Procedure Call.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
CS425 /CSE424/ECE428 – Distributed Systems – Fall Nikita Borisov - UIUC1 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S.
Information Management NTU Interprocess Communication and Middleware.
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.
Lecture 15-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) October 12, 2010 Lecture 15 RPCs and Distributed.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
Systems Prog. & Script. - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 11: The Distributed Object Model.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION. Introduction This chapter is concerned with programming models for distributed applications... Familiar programming.
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Distributed Objects and Remote Invocation Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts.
Slides for Chapter 5: Distributed objects and remote invocation From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition.
1 Distribuerede systemer og sikkerhed – 28. februar 2002 From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Distributed objects and remote invocation Pages
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems Lecture 8 RPC and marshalling 1.
Topic 5: CORBA RMI Dr. Ayman Srour
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Java Distributed Computing
Chapter 4 Remote Method Invocation
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Chapter 5 Remote Procedure Call
Java Distributed Computing
Remote Method Invocation
Out-of-Process Components
Edition 5, © Addison-Wesley 2012
Text extensions to slides © David E. Bakken,
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Slides for Chapter 6: Operating System support
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Slides for Chapter 5: Distributed objects and remote invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Creating a Distributed System with RMI
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote method invocation (RMI)
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Distribution Infrastructures
Exercises for Chapter 20: CORBA CASE STUDY
Out-of-Process Components
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Java Remote Method Invocation
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Text extensions to slides © David E. Bakken,
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Programming Models for Distributed Application Remote procedure call – client calls the procedures in a server program that is running in a different process Remote method invocation (RMI) – an object in one process can invoke methods of objects in another process Event notification – objects receive notification of events at other objects for which they have registered These mechanism must be location-transparent. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Remote Interface (RMI) specifies methods of an object available for remote invocation input and output parameters may be objects Remote Method Invocation communication actual arguments marshaled and sent to server server unmarshals packet, performs procedure, and sends marshaled return packet to caller client unmarshals return packet common format definition for how to pass objects (e.g., CORBA IDL or Java RMI) Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

1.Design issues for RMI-The Object Model An object encapsulates data and methods. Objects can be accessed via object references. An interface provides a definition of the signatures of a set of methods(arguments, return values and exceptions) without specifying their implementation Actions are performed by method invocations (object invoks a method in another object.) The state of receiver may be changed. A new object may be instantiated, for example, by using a constructor in Java or C++. Further invocations of methods on other objects may take place.

Exceptions may be thrown to caller when an error occurs. Garbage collection frees the space occupied by objects when they are no longer needed. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

The Distributed Objects Model-DOM Remote method invocation – Method invocations between objects in different processes, whether in the same computer or not. Local method invocation – Method invocations between objects in the same process. Remote object – Objects that can receive remote invocations. Remote and local method invocations are shown in Figure 5.3. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Figure 5.3 invocation remote local A B C D E F each process contains objects, some of which can receive remote invocations, others only local invocations those that can receive remote invocations are called remote objects objects need to know the remote object reference of an object in another process in order to invoke its methods. How do they get it? the remote interface specifies which methods can be invoked remotely • Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Two fundamental concepts are the heart of the DOM Remote object reference Other objects can invoke the methods of a remote object if they have access to its remote object reference. For example, a remote object reference for B in Figure3 must be available to A. Remote interface Every remote object has a remote interface that specifies which of its methods can be invoked remotely. For example, the objects B and F in Figure 5.12 must have remote interfaces. CORBA – uses IDL to specify remote interface JAVA – extends interface by the Remote keyword. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Figure 5.4 A remote object and its remote interface Data implementation object { of methods Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Actions in a distributed object system Non-distributed case, an action is initiated by a method invocation, which may result in further invocations on methods in other objects. But in the distributed case, the objects involved in a chain of related invocations may be located in different processes or different computers. When an invocation crosses the boundary of a process or computer, RMI is used, and the remote reference of the object must be available to the invoker Garbage collection in a distributed-object system Exceptions

2.Implementation of RMI Figure showed an object A invokes a method in a remote object B. Communication module: Request-Reply Protocol Responsible for providing selected invocation semantics The server selects the dispatcher for the class of the object to be invoked. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

The Architecture of Remote Method Invocation Figure 5.6 object A object B skeleton Request proxy for B Reply Communication Remote Remote reference module reference module for B’s class & dispatcher remote client server Skeleton - implements methods in remote interface. Unmarshals requests and marshals results. Invokes method in remote object. Proxy - makes RMI transparent to client. Class implements remote interface. Marshals requests and unmarshals results. Forwards request. Dispatcher - gets request from communication module and invokes method in skeleton (using methodID in message). carries out Request-reply protocol translates between local and remote object references and creates remote object references. Uses remote object table describe animation - First just shows the figure 5.6 then bring in descriptions of communication and remote reference modules then text on RMI software then proxy, skeleton and dispatcher RMI software - between application level objects and communication and remote reference modules • Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Proxy - makes RMI transparent to client Proxy - makes RMI transparent to client. Class implements remote interface. Marshals requests and unmarshals results. Forwards request. Skeleton - implements methods in remote interface. Unmarshals requests and marshals results. Invokes method in remote object. Dispatcher - gets request from communication module and invokes method in skeleton (using methodID in message). Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Remote Reference Module Responsibilities translation between local and remote object references remote object table - entry for each remote object held by process - entry for each local proxy arriving remote object reference - creation of remote object references creation of remote object references need to pass a remote object - look up in remote object table (create new remote object reference and add entry if necessary) Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Servants A servant is an instance of a class that provides the body of a remote object. Servants live within a server process. handles the remote requests passed on by the corresponding skeleton. They are created when remote objects are instantiated and remain in use until they are no longer needed, finally being garbage collected or deleted. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Software Proxy - provides remote invocation transparency marshal arguments, unmarshal results, send and receive messages Dispatcher - handles transfer of requests to correct method receive requests, select correct method, and pass on request message Skeleton - implements methods of remote interface unmarshal arguments from request, invoke the method of the remote object, and marshal the results Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Generation of the classes for proxies, dispatchers and skeletons The classes for the proxy, dispatcher and skeleton used in RMI are generated automatically by an interface compiler. Dynamic invocation: An alternative to proxies The proxy just described is static, in the sense that its class is generated from an interface definition and then compiled into the client code. Sometimes this is not practical, though Dynamic invocation gives the client access to a generic representation of a remote invocation like the doOperation method The client will supply the remote object reference, the name of the method and the arguments to doOperation and then wait to receive the results. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Server and Client Programs classes for dispatchers, skeletons and remote objects registration of remote objects with the binder Client classes for proxies of all remote objects binder to look up remote object references cannot create remote objects by directly calling constructors – instead provide factory methods factory method is sometimes used to refer to a method that creates servants, and a factory object is an object with factory methods. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Binder and Server Threads A binder in a distributed system is a separate service that maintains a table containing mappings from textual names to remote object references. Server threads sometimes implemented so that remote invocation causes a new thread to be created to handle the call server with several remote objects might also allocate separate threads to handle each object What are the advantages/disadvantages of each approach? What other threading organizations could be used? Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Binder and Server Threads Activation of remote objects A remote object is described as active when it is a running process. A remote object is described as passive when it can be made active if requested. An object that can live between activations of processes is called a persistent object. A location service helps clients to locate remote objects from their remote references. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Distributed Garbage Collection Aim - recover memory if no reference to an object exist. If there is a reference object should still exists. Java distributed algorithm - based on reference counting The distributed garbage collector works in cooperation with the local garbage collector. . Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

RMI Distributed Garbage Collection The distributed garbage collection (continued): When remote object B is no longer reachable, it deletes the proxy and invokes removeRef(B). When B.holders is empty, the server reclaim the space occupied by B. Leases in Jini To avoid complicated protocols to discover whether a resource are still used, the resource is leased for use for a period of time. An object representing a lease implements the Lease interface. Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000