Distributed Systems Architecture

Size: px
Start display at page:

Download "Distributed Systems Architecture"

Transcription

1 Distributed Systems Architecture Lab Session 1. Introduction to ZeroC Ice Francisco Moya November 15, 2011 In this session we will learn to use basic Ice tools to develop a very simple distributed application. It will be developed in two steps. First, we will describe a bottom-up approach to building a distributed hello world example. Although quite similar, this is not the usual workflow for experienced Ice developers, but we will use it as an excuse to introduce several important concepts. Afterwards we will use some of the services provided by Ice to enhance the developer experience in the actual computer network. 1 Introduction Most object-oriented distributed middlewares, such as ZeroC Ice, use a technique developed in the late 80 s and early 90 s called Remote Method Invocation (RMI). This technique essentially attempts to replicate the behavior of normal method invocations to model remote interactions among components. Figure 1 shows a schematic view of the inner workings of a client computer invoking a method on a remote object running on a server computer. A remote object is an object whose methods may be invoked remotely. This is implemented by interposing an intermediate infrastructure such as the one depicted in figure 1. Remote objects are constructed in a similar way to ordinary objects, but they require an additional registration operation to publish their functionality through the network. Figure 1: Remote method invocation. 1

2 November 15, 2011 lab-ice-intro-java.nw 2 Figure 2: Simplified sequence diagram for a successful RMI. The interaction sequence shown in 2 shows the whole process. When a remote client invokes a remote method on a remote object it just invokes an ordinary method on a local proxy object residing in the same computer. Then the proxy object translates this invocation into a request message sent through the network by a communications kernel and waits for a response. At the server computer the request message is decoded and forwarded to a skeleton. The skeleton identifies the destination object, the method to be invoked and the arguments, and performs the actual invocation on the remote object implementation. Afterwards, it packages the return value in a response message which is then sent back through the network. The proxy, which was waiting for the response, decodes the return value which is then returned to the client. The proxy acts as a representative of the remote object at the client-side. It behaves as a pointer to the remote object although the object is not in the same address space. The proxy implements the same methods as the remote object but everything is translated to a request message through the network. The skeleton is the complementary part in the server side. It receives request messages from proxies and return response messages when the actual method is invoked. Fortunately proxies and skeletons are automatically generated from an abstract specification of the interfaces. Therefore everything related to the network is provided by the middleware. Most of the details of network programming are not visible to the programmer of distributed applications. In the following sections we will describe in detail how to develop a simple distributed application using a specific object-oriented distributed middleware, the Internet Communications Engine (Ice), developed by ZeroC, Inc. 2 Overall architecture design The first step in the development of any distributed application is the identification of the components and the characterization of the interactions among them. In this example we will implement a distributed version of the well-known hello world application. The application will be composed of two components. A server component runs on a computer and awaits for text messages to display in the console. A client component runs on a different computer and sends the well-known "Hello,

3 November 15, 2011 lab-ice-intro-java.nw 3 Figure 3: Overall architecture of the distributed hello world example. World!" message to the server. Any of these components may be run on any computer. They may even be run on the same computer. This property is frequently referred to as location transparency and plays an important role in the development of truly scalable distributed applications. 3 Interface specification Once the global architecture and the interactions among components are well-defined then these interactions must be translated into a formal specification. Most modern middlewares use an abstract interface description language (IDL) to specify possible interactions in terms of object interfaces. ZeroC Ice uses a language called Slice as the only specification language. Slice is some kind of an hybrid among C++, Java, or C# but remains as a purely declarative language. There is no way to express a sequece of actions. Since our application does only require interactions initiated by the client and served by the server component then we just need a single remote interface. That interface must be implemented in the server-side and exercised from the client-side. 3 Hello.ice 3 module UCLM { interface Hello { void puts(string str); ; ;

4 November 15, 2011 lab-ice-intro-java.nw 4 Slice files usually have an.ice extension. Any Slice specification must define at least a module, which contains one or more interface specifications. In this case we use the UCLM module which contains the Hello interface. In our example there is just one possible type of interaction between remote components: The client may send a textual message to the server. Therefore we just need a single method puts which stands for put string and requires just the textual message (a string). 4 Proxy and skeleton generation The Slice file is used as the abstract specification of the remote interactions. Each of the components must know the Slice interfaces in order to be able to interact with other components. As described in section1, those components with an active role in the interactions (initiators or callers) must use proxies which implement the remote object interface and translates the invocations into messages through the network. Those components with a passive role in the interactions (components waiting for remote invocations) must use skeletons which translate network messages into actual method calls in the remote object implementation. Proxies and skeletons are generated by compiling the Slice specifications. There is a Slice compiler for each of the supported implementation languages. In this lab session we will be using Java and therefore we must use the slice2java Slice compiler. 4 Slice file compilation 4 slice2java Hello.ice

5 November 15, 2011 lab-ice-intro-java.nw 5 The compiler generates a bunch of files under the UCLM subdirectory: Client side Server side Hello.java HelloOperations.java HelloOperationsNC.java HelloPrx.java HelloDisp.java HelloPrxHelper.java HelloHolder.java HelloPrxHolder.java HelloDel.java HelloDelD.java HelloDelM.java The HelloPrx class implements the proxy and the HelloDisp class implements the base class for the skeleton. Most of the remaining files constitute implementation details that are hidden to the user. 5 Servant implementation 5a 5b The remote object implementation is usually called servant. There is a subtle difference between object and servant but we do not need to point this out in our first lab session. The compiler generated a class UCLM. HelloDisp that must be used as the base class of any servant implementation. The servant (object implementation) just needs to derive from UCLM. HelloDisp and implement the methods declared in the Hello interface. It is even easier if we use the Slice compiler switch --impl to generate a sample implementation. Generation of sample servant from a Slice file 5a slice2java --impl Hello.ice In this case the compiler generates an extra file named HelloI.java. This is just an example that may be used as a starting point for our own implementation. Let us look into the UCLM/HelloI.java file: Auto generated HelloI.java 5b package UCLM; public final class HelloI extends _HelloDisp { public HelloI() { public void puts(string str, Ice.Current current) {

6 November 15, 2011 lab-ice-intro-java.nw 6 6a This file declares a servant (object implementation). It is already defined as a derived class of UCLM. HelloDisp and declares the right Java syntax equivalent to the Slice specification. You probably noticed that a Slice string parameter is equivalent to a Java standard String, and a new parameter was appended to the end. The last parameter captures the context of the remote invocation. It will not be used in most of the lab sessions but we will show its usefulness later. The HelloI.java file is a stub with an empty implementation of the methods declared in the Slice file. The user must fill in the empty body of the methods. UCLM/HelloI.java 6a package UCLM; public final class HelloI extends _HelloDisp { public HelloI() { public void puts(string str, Ice.Current current) { Implementation of method puts 6b We just need to insert a trivial implementation of the puts method. We just use the standard Java console IO classes to print the string in the console. 6b Implementation of method puts 6b (6a) System.out.println(str); We already finished the servant implementation. Any instance of the HelloI class will be able to be invoked remotely if we first register the instance in the communications kernel. 6 Server application 6c The easiest way to develop a ZeroC Ice application is to derive a class from Ice.Application. Among other things this class takes care of proper initialization and finalization of the communications core (the communicator). We just need to provide a run method, which uses a signature similar to a main method. UCLM/Server.java 6c package UCLM; import Ice.*; class Server extends Ice.Application { public int run(string[] args) { Server implementation 7d return 0; ; Definition of main method 7e

7 November 15, 2011 lab-ice-intro-java.nw 7 One nice thing about this class is that the communications kernel is always available by invoking the communicator() method. This is extremely convenient to register a remote object. In Ice applications the connection between a remote object implementation and the communicator is achieved by means of an intermediate object adapter. A single object adapter may handle request messages for many remote objects. In the backstage the object adapter implements a concurrent multi-threaded server carefully fine-tuned to be able to process thousands of concurrent requests. The structure of most Ice applications is quite similar. We first create an object adapter, then we add to this adapter a set of remote object implementations (servants) and, finally, we activate the adapter to start processing requests from remote clients. 7a Object registration 7a (7d) ObjectAdapter oa = communicator().createobjectadapter("oa"); ObjectPrx prx = oa.add(new HelloI(), Identity of the remote object 7b ); oa.activate(); As the code shows, the add method requires two arguments, a servant (remote object implementation) and an object identity. This identity must be unique in the whole distributed system. Therefore a rather large identity is usually used. In this example we will be using an extremely simple identity for illustration purposes. Usually there is no need to know the structure of an object identity. The communicator may generate an appropriate identity from a user provided string. 7b Identity of the remote object 7b (7a) communicator().stringtoidentity("hello1") Once the object adapter is activated there is no need to do anything more. The activate method creates a new thread listening to network events. But we must do something because otherwise the run method would finish, and then the Ice.Application would shutdown the communicator. In these cases we may just wait for communicator shutdown. Besides, it would be convenient to shutdown the communicator if the user interrupts the program (typically by pressing Control-C). 7c Wait forever loop 7c (7d) shutdownoninterrupt(); communicator().waitforshutdown(); The server application is now complete. But for illustration purposes we will add some debugging information. When we add a servant to an object adapter, the object adapter returns a proxy. This proxy may be sent and use from anywhere in the whole computer network to contact the newly added remote object implementation. Let us print the returned proxy as a character string: 7d Server implementation 7d (6c) Object registration 7a System.out.println(communicator().proxyToString(prx)); Wait forever loop 7c Finally we just need to instantiate the server application. As in any Ice.Application we must invoke the main method which is quite similar to the standard main function. 7e Definition of main method 7e (6c) static public void main(string[] args) { Server app = new Server(); app.main("server", args);

8 November 15, 2011 lab-ice-intro-java.nw 8 8a 8b 8c To get a running executable we just need to compile Server.java using the java compiler together with the Ice library. Server compilation 8a javac -classpath /usr/share/java/ice.jar:. UCLM/Server.java The argument -classpath indicates that the compiler must look into the definitions included in the Ice library distribution and also in the current directory. 6.1 Running the server If we try to run the server now we would get a run-time error because object adapters require configuration. Ice configuration consists on a sequence of key-value pairs separated by = in a simple text file. For an object adapter we need to specify at least the endpoints, the transport protocols that should be used to contact the remote objects registered in the adapter. hello.cfg 8b OA.Endpoints=tcp -p 9090 The object adapter named OA will be available through TCP using port If no port is specified then a free port would be automatically selected. Now we may run the server specifying the new configuration file: Running the server 8c java -classpath /usr/share/java/ice.jar \ UCLM.Server --Ice.Config=hello.cfg

9 November 15, 2011 lab-ice-intro-java.nw 9 As a result the server will print something similar to the following: hello1 -t:tcp -h p 9090 Let us recall that the server prints a textual representation of the proxy created when a servant is added to an object adapter. The structure of the proxy is shown explicitly: A proxy holds the identity of the object it is pointing to (hello1 in this case). It may also be configured to interact with the remote side in different ways. In this case the proxy is configured as twoway (-t) which means that both request and response messages are acknowledged by the receiver. Finally a proxy contains a list of the endpoints used to contact the remote object. In this case the remote object may be contacted using the TCP protocol to connect to host at port Client application The client side is much simpler. Once we have a proxy we may use it as if it where a pointer to a local object. Therefore the main problem is how to get a proxy to the remote object. As we already explained above, proxies are returned by the add method of the object adapters at the server side. There are several techniques to make these proxies available to the client side but we will use the simplest one, reconstruction of the proxy form the textual representation given as a command line argument. Once we have a proxy we must coherce it into a specialized proxy implementing the Slice interface. In this case we need a UCLM.Hello proxy. This is easily achieved with the static method checkedcast of the UCLM.HelloPrxHelper class. Finally we may just invoke remote methods as if it were a local object. 9a Client implementation 9a (9b) ObjectPrx obj = communicator().stringtoproxy(args[0]); HelloPrx hello = HelloPrxHelper.checkedCast(obj); hello.puts("hello, World!"); 9b As in the case of the server, we use an Ice.Application to simplify the initialization and finalization of the communicator. UCLM/Client.java 9b package UCLM; import Ice.*; class Client extends Ice.Application { public int run(string[] args) { Client implementation 9a return 0; ; static public void main(string[] args) { Application app = new Client(); app.main("client", args);

10 November 15, 2011 lab-ice-intro-java.nw 10 10a To get a running executable we just need to compile Client.java together with the Ice library. Client compilation 10a javac -classpath /usr/share/java/ice.jar:. UCLM/Client.java 10b 7.1 Running the client The client may be run in any computer connected to the same network as the server. It is run by specifying the textual representation of the proxy in the command line: Running the client 10b java -classpath /usr/share/java/ice.jar UCLM.Client \ "hello1 -t:tcp -h p 9090" 10c 7.2 Troubleshooting Depending on the version of the Ice distribution and the Java distribution you use you may experience that the client is not able to contact the server. This is usually a configuration problem. By default modern operating systems use IPv6 and IPv4 as separate networking stacks. Therefore when a socket is bound to an IPv6 address it cannot communicate to an IPv4 peer. In GNU/Linux distributions you may change this default behaviour by editing /etc/sysctl.d/bindv6only.conf (preferred) or /etc/sysctl.conf to add the following parameter: /etc/sysctl.d/bindv6only.conf 10c net.ipv6.bindv6only = 0 8 Tips on packaging 10d 10e As this little example shows, running a Java program from the command line may be quite cumbersome. It is usually more user friendly to create a packaged JAR file with all of the information required to run the program. In order to create a JAR file you should use a manifest file stating the required Class-Path and the name of the class with the main static method. For example, for the server you may use the following minimal manifest file: Server.mft 10d Manifest-Version: 1.0 Class-Path: /usr/share/java/ice.jar Main-Class: UCLM.Server Note that the full path to the Ice library is included in the Class-Path declaration of the manifest file. Unlike the command line argument -classpath, multiple libraries should be separated by spaces. Be careful to end the Main-Class declaration with a newline character. Now you may build the JAR archive as follows: Generation of server JAR archive 10e jar cmf Server.mft Server.jar UCLM/*.class

11 November 15, 2011 lab-ice-intro-java.nw 11 All that is needed to run the server is this JAR archive. And the command line is much simpler: 11 Running the server JAR archive 11 java -jar Server.jar --Ice.Config=hello.cfg 9 Epilogue In this session we built a complete distributed application. Communication details are left out of the developers work. Try to modify the examples from this session in as many ways as possible. Here you have some suggestions: Substitute the checkedcast call by an uncheckedcast. Now experiment with the config file changing the endpoints to udp, or even tcp:udp. At the same time you will need to experiment changing the twoway communication mode (-t) to a datagram communication mode (-d). Add more methods with different types of arguments, with return values, and with more than one argument. Invoke them from the client. 10 Chunks /etc/sysctl.d/bindv6only.conf 10c Auto generated HelloI.java 5b Client compilation 10a Client implementation 9a Definition of main method 7e Generation of sample servant from a Slice file 5a Generation of server JAR archive 10e hello.cfg 8b Hello.ice 3 Identity of the remote object 7b Implementation of method puts 6b Object registration 7a Running the client 10b Running the server 8c Running the server JAR archive 11 Server compilation 8a Server implementation 7d Server.mft 10d Slice file compilation 4 UCLM/Client.java 9b UCLM/HelloI.java 6a UCLM/Server.java 6c Wait forever loop 7c

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC) COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC) 1 2 CONVENTIONAL PROCEDURE CALL (a) (b) Parameter passing in a local procedure call: the stack before the call to read. The stack while the called procedure

More information

Remote Objects and RMI

Remote Objects and RMI Outline Remote Objects and RMI Instructor: Dr. Tongping Liu Distributed/Remote Objects Remote object reference (ROR) Remote Method Invocation (RMI) Case study and example: Java RMI Other issues for objects

More information

Communication. Distributed Systems Santa Clara University 2016

Communication. Distributed Systems Santa Clara University 2016 Communication Distributed Systems Santa Clara University 2016 Protocol Stack Each layer has its own protocol Can make changes at one layer without changing layers above or below Use well defined interfaces

More information

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01 Introduction & RMI Basics CS3524 Distributed Systems Lecture 01 Distributed Information Systems Distributed System: A collection of autonomous computers linked by a network, with software to produce an

More information

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications Distributed Objects and Remote Invocation Programming Models for Distributed Applications Extending Conventional Techniques The remote procedure call model is an extension of the conventional procedure

More information

CS 5523 Operating Systems: Remote Objects and RMI

CS 5523 Operating Systems: Remote Objects and RMI CS 5523 Operating Systems: Remote Objects and RMI Instructor: Dr. Tongping Liu Thank Dr. Dakai Zhu and Dr. Palden Lama for providing their slides. Outline Distributed/Remote Objects Remote object reference

More information

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

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4 EEC-681/781 Distributed Computing Systems Lecture 4 Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org Outline Inter-process communications Computer networks

More information

5.4. Events and notifications

5.4. Events and notifications 5.4. Events and notifications Distributed event-based systems extend local event model Allowing multiple objects at diff. locations to be notified of events taking place at an object Two characteristics:

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Distributed Systems. 5. Remote Method Invocation

Distributed Systems. 5. Remote Method Invocation Distributed Systems 5. Remote Method Invocation Werner Nutt 1 Remote Method Invocation 5.1 Communication between Distributed Objects 1. Communication between Distributed Objects 2. RMI 2 Middleware Middleware

More information

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

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration Sockets Defined as an endpoint for communcation Concatenation of IP

More information

Distributed Systems Principles and Paradigms. Distributed Object-Based Systems. Remote distributed objects. Remote distributed objects

Distributed Systems Principles and Paradigms. Distributed Object-Based Systems. Remote distributed objects. Remote distributed objects Distributed Systems Principles and Paradigms Maarten van Steen VU Amsterdam, Dept. Computer Science steen@cs.vu.nl Chapter 10: Version: December 10, 2012 1 / 22 10.1 Architecture 10.1 Architecture Remote

More information

Advanced Topics in Operating Systems

Advanced Topics in Operating Systems Advanced Topics in Operating Systems MSc in Computer Science UNYT-UoG Dr. Marenglen Biba 8-9-10 January 2010 Lesson 10 01: Introduction 02: Architectures 03: Processes 04: Communication 05: Naming 06:

More information

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1 Message Passing vs. Distributed Objects 5/15/2009 Distributed Computing, M. L. Liu 1 Distributed Objects M. L. Liu 5/15/2009 Distributed Computing, M. L. Liu 2 Message Passing versus Distributed Objects

More information

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 Getting Started. Getting Started (v1.8.6) 3/5/2007 2 Getting Started Java will be used in the examples in this section; however, the information applies to all supported languages for which you have installed a compiler (e.g., Ada, C, C++, Java) unless

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Chapter 5: Distributed objects and remote invocation

Chapter 5: Distributed objects and remote invocation Chapter 5: Distributed objects and remote invocation From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, Addison-Wesley 2005 Figure 5.1 Middleware layers Applications

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Ibis RMI User s Guide

Ibis RMI User s Guide Ibis RMI User s Guide http://www.cs.vu.nl/ibis November 16, 2009 1 Introduction Java applications typically consist of one or more threads that manipulate a collection of objects by invoking methods on

More information

LECTURE 2 (Gaya College of Engineering)

LECTURE 2 (Gaya College of Engineering) LECTURE 2 (Gaya College of Engineering) 1) CHARACTERISTICS OF OBJECTS: Object is an instance of a class. So, it is an active entity. Objects have three basic characteristics. They are- State: An object

More information

CS193k, Stanford Handout #12. Threads 4 / RMI

CS193k, Stanford Handout #12. Threads 4 / RMI CS193k, Stanford Handout #12 Spring, 99-00 Nick Parlante Threads 4 / RMI Semaphore1 Semaphore1 from last time uses the count in a precise way to know exactly how many threads are waiting. In this way,

More information

Java RMI Middleware Project

Java RMI Middleware Project Java RMI Middleware Project Nathan Balon CIS 578 Advanced Operating Systems December 7, 2004 Introduction The semester project was to implement a middleware similar to Java RMI or CORBA. The purpose of

More information

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

Distributed Systems. The main method of distributed object communication is with remote method invocation Distributed Systems Unit III Syllabus:Distributed Objects and Remote Invocation: Introduction, Communication between Distributed Objects- Object Model, Distributed Object Modal, Design Issues for RMI,

More information

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI Prof. Dr. Claudia Müller-Birn Institute for Computer Science, Networked Information Systems Distributed object component middleware I - Java RMI Nov 15th, 2011 Netzprogrammierung (Algorithmen und Programmierung

More information

Distributed Information Systems

Distributed Information Systems Distributed Objects and Remote Invocation Programming Models For Distributed Applications Objectives RPC and RMI. Remote invocation semantics. Implementation of RMI. References DSCD: Chapter 5 Conventional

More information

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

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A Contents Java RMI G53ACC Chris Greenhalgh Java RMI overview A Java RMI example Overview Walk-through Implementation notes Argument passing File requirements RPC issues and RMI Other problems with RMI 1

More information

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI Prof. Dr. Claudia Müller-Birn Institute for Computer Science, Networked Information Systems Distributed object component middleware I - Java RMI Nov 15th, 2011 Netzprogrammierung (Algorithmen und Programmierung

More information

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build Software Development COMP220/COMP285 Seb Coope Ant: Structured Build These slides are mainly based on Java Development with Ant - E. Hatcher & S.Loughran. Manning Publications, 2003 Imposing Structure

More information

COMP90015: Distributed Systems Assignment 1 Multi-threaded Dictionary Server (15 marks)

COMP90015: Distributed Systems Assignment 1 Multi-threaded Dictionary Server (15 marks) COMP90015: Distributed Systems Assignment 1 Multi-threaded Dictionary Server (15 marks) Problem Description Using a client-server architecture, design and implement a multi-threaded server that allows

More information

Lecture 5: Object Interaction: RMI and RPC

Lecture 5: Object Interaction: RMI and RPC 06-06798 Distributed Systems Lecture 5: Object Interaction: RMI and RPC Distributed Systems 1 Recap Message passing: send, receive synchronous versus asynchronous No global Time types of failure socket

More information

CHAPTER - 4 REMOTE COMMUNICATION

CHAPTER - 4 REMOTE COMMUNICATION CHAPTER - 4 REMOTE COMMUNICATION Topics Introduction to Remote Communication Remote Procedural Call Basics RPC Implementation RPC Communication Other RPC Issues Case Study: Sun RPC Remote invocation Basics

More information

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

DISTRIBUTED OBJECTS AND REMOTE INVOCATION DISTRIBUTED OBJECTS AND REMOTE INVOCATION Introduction This chapter is concerned with programming models for distributed applications... Familiar programming models have been extended to apply to distributed

More information

Threads SPL/2010 SPL/20 1

Threads SPL/2010 SPL/20 1 Threads 1 Today Processes and Scheduling Threads Abstract Object Models Computation Models Java Support for Threads 2 Process vs. Program processes as the basic unit of execution managed by OS OS as any

More information

CSE 230 Intermediate Programming in C and C++ Functions

CSE 230 Intermediate Programming in C and C++ Functions CSE 230 Intermediate Programming in C and C++ Functions Fall 2017 Stony Brook University Instructor: Shebuti Rayana shebuti.rayana@stonybrook.edu http://www3.cs.stonybrook.edu/~cse230/ Concept of Functions

More information

JAVA RMI. Remote Method Invocation

JAVA RMI. Remote Method Invocation 1 JAVA RMI Remote Method Invocation 2 Overview Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space. The other address space could be: On the same

More information

RMI: Design & Implementation

RMI: Design & Implementation RMI: Design & Implementation Operating Systems RMI 1 Middleware layers Applications, services RMI and RPC request-reply protocol marshalling and external data representation Middleware layers UDP and TCP

More information

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008 Distributed Systems Theory 4. Remote Procedure Call October 17, 2008 Client-server model vs. RPC Client-server: building everything around I/O all communication built in send/receive distributed computing

More information

Getting Started (1.8.7) 9/2/2009

Getting Started (1.8.7) 9/2/2009 2 Getting Started For the examples in this section, Microsoft Windows and Java will be used. However, much of the information applies to other operating systems and supported languages for which you have

More information

Methods. CSE 114, Computer Science 1 Stony Brook University

Methods. CSE 114, Computer Science 1 Stony Brook University Methods CSE 114, Computer Science 1 Stony Brook University http://www.cs.stonybrook.edu/~cse114 1 Opening Problem Find multiple sums of integers: - from 1 to 10, - from 20 to 30, - from 35 to 45,... 2

More information

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

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University CS 555: DISTRIBUTED SYSTEMS [RPC & DISTRIBUTED OBJECTS] Shrideep Pallickara Computer Science Colorado State University Frequently asked questions from the previous class survey XDR Standard serialization

More information

RPC and RMI. 2501ICT Nathan

RPC and RMI. 2501ICT Nathan RPC and RMI 2501ICT Nathan Contents Client/Server revisited RPC Architecture XDR RMI Principles and Operation Case Studies Copyright 2002- René Hexel. 2 Client/Server Revisited Server Accepts commands

More information

DISTRIBUTED COMPUTING

DISTRIBUTED COMPUTING DISTRIBUTED COMPUTING SYSTEMS 1 REMOTE PROCEDURE CALL RPC-REMOTE PROCEDURE CALL RMI-REMOTE METHOD INVOCATION 2 3 RPC TECHNOLOGY Remote procedure call is a technology that allows computer programs to call

More information

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

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2) Introduction Objective To support interoperability and portability of distributed OO applications by provision of enabling technology Object interaction vs RPC Java Remote Method Invocation (RMI) RMI Registry

More information

Object-Oriented Systems Design RMI

Object-Oriented Systems Design RMI Object-Oriented Systems Design RMI Michael Hauser November 2001 Workshop: AW3 Module: EE5029A Tutor: Mr. Müller Course: M.Sc Distributes Systems Engineering Lecturer: Mr. Prowse CONTENTS Contents 1 Aims

More information

Every language has its own scoping rules. For example, what is the scope of variable j in this Java program?

Every language has its own scoping rules. For example, what is the scope of variable j in this Java program? Lexical Binding There are two ways a variable can be used in a program: As a declaration As a "reference" or use of the variable Scheme has two kinds of variable "declarations" -- the bindings of a let-expression

More information

Lab # 2. For today s lab:

Lab # 2. For today s lab: 1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you

More information

Verteilte Systeme (Distributed Systems)

Verteilte Systeme (Distributed Systems) Verteilte Systeme (Distributed Systems) Karl M. Göschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 3: Communication (Part 2) Remote Procedure

More information

Remote Procedure Call

Remote Procedure Call Remote Procedure Call Suited for Client-Server structure. Combines aspects of monitors and synchronous message passing: Module (remote object) exports operations, invoked with call. call blocks (delays

More information

Last Class: RPCs. Today:

Last Class: RPCs. Today: Last Class: RPCs RPCs make distributed computations look like local computations Issues: Parameter passing Binding Failure handling Lecture 8, page 1 Today: Lightweight RPCs Remote Method Invocation (RMI)

More information

Chapter 4 Remote Procedure Calls and Distributed Transactions

Chapter 4 Remote Procedure Calls and Distributed Transactions Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 4 Remote Procedure Calls and Distributed Transactions Outline

More information

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

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI 03 Remote invoaction Request-reply RPC Coulouris 5 Birrel_Nelson_84.pdf RMI 2/23 Remote invocation Mechanisms for process communication on a Built on top of interprocess communication primitives Lower

More information

Interprocess Communication

Interprocess Communication Interprocess Communication Nicola Dragoni Embedded Systems Engineering DTU Informatics 4.2 Characteristics, Sockets, Client-Server Communication: UDP vs TCP 4.4 Group (Multicast) Communication The Characteristics

More information

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004 Middleware Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004 Outline Web Services Goals Where do they come from? Understanding middleware Middleware as infrastructure Communication

More information

Communication and Distributed Processing

Communication and Distributed Processing Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 4 Remote Procedure Calls and Distributed Transactions Outline

More information

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

BEAAquaLogic. Service Bus. Interoperability With EJB Transport BEAAquaLogic Service Bus Interoperability With EJB Transport Version 3.0 Revised: February 2008 Contents EJB Transport Introduction...........................................................1-1 Invoking

More information

Project 1: Remote Method Invocation CSE 291 Spring 2016

Project 1: Remote Method Invocation CSE 291 Spring 2016 Project 1: Remote Method Invocation CSE 291 Spring 2016 Assigned: Tuesday, 5 April Due: Thursday, 28 April Overview In this project, you will implement a remote method invocation (RMI) library. RMI forwards

More information

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015 ActiveSpaces Transactions Quick Start Guide Software Release 2.5.0 Published May 25, 2015 Important Information SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG 1 Notice Class Website http://www.cs.umb.edu/~jane/cs114/ Reading Assignment Chapter 1: Introduction to Java Programming

More information

Life Without NetBeans

Life Without NetBeans Life Without NetBeans Part A Writing, Compiling, and Running Java Programs Almost every computer and device has a Java Runtime Environment (JRE) installed by default. This is the software that creates

More information

Communication. Overview

Communication. Overview Communication Chapter 2 1 Overview Layered protocols Remote procedure call Remote object invocation Message-oriented communication Stream-oriented communication 2 Layered protocols Low-level layers Transport

More information

5 Distributed Objects: The Java Approach

5 Distributed Objects: The Java Approach 5 Distributed Objects: The Java Approach Main Points Why distributed objects Distributed Object design points Java RMI Dynamic Code Loading 5.1 What s an Object? An Object is an autonomous entity having

More information

MODELS OF DISTRIBUTED SYSTEMS

MODELS OF DISTRIBUTED SYSTEMS Distributed Systems Fö 2/3-1 Distributed Systems Fö 2/3-2 MODELS OF DISTRIBUTED SYSTEMS Basic Elements 1. Architectural Models 2. Interaction Models Resources in a distributed system are shared between

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 4a Andrew Tolmach Portland State University 1994-2016 Pragmatics of Large Values Real machines are very efficient at handling word-size chunks of data (e.g.

More information

CORBA (Common Object Request Broker Architecture)

CORBA (Common Object Request Broker Architecture) CORBA (Common Object Request Broker Architecture) René de Vries (rgv@cs.ru.nl) Based on slides by M.L. Liu 1 Overview Introduction / context Genealogical of CORBA CORBA architecture Implementations Corba

More information

Remote Procedure Call

Remote Procedure Call Remote Procedure Call Remote Procedure Call Integrate network communication with programming language Procedure call is well understood implementation use Control transfer Data transfer Goals Easy make

More information

Certified Core Java Developer VS-1036

Certified Core Java Developer VS-1036 VS-1036 1. LANGUAGE FUNDAMENTALS The Java language's programming paradigm is implementation and improvement of Object Oriented Programming (OOP) concepts. The Java language has its own rules, syntax, structure

More information

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36 Communication address calls class client communication declarations implementations interface java language littleendian machine message method multicast network object operations parameters passing procedure

More information

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

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9, Distributed Object Systems 2 Java RMI Piet van Oostrum Distributed Systems What should a distributed system provide? Illusion of one system while running on multiple systems Transparancy Issues Communication,

More information

Chapter 4 Java Language Fundamentals

Chapter 4 Java Language Fundamentals Chapter 4 Java Language Fundamentals Develop code that declares classes, interfaces, and enums, and includes the appropriate use of package and import statements Explain the effect of modifiers Given an

More information

Generic architecture

Generic architecture Java-RMI Lab Outline Let first builds a simple home-made framework This is useful to understand the main issues We see later how java-rmi works and how it solves the same issues Generic architecture object

More information

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

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma Distributed and Agent Systems Prof. Agostino Poggi What is CORBA? CORBA (Common Object Request

More information

Distributed Information Processing

Distributed Information Processing Distributed Information Processing 5 th Lecture Eom, Hyeonsang ( 엄현상 ) Department of Computer Science & Engineering Seoul National University Copyrights 2017 Eom, Hyeonsang All Rights Reserved Outline

More information

Lecture 2, September 4

Lecture 2, September 4 Lecture 2, September 4 Intro to C/C++ Instructor: Prashant Shenoy, TA: Shashi Singh 1 Introduction C++ is an object-oriented language and is one of the most frequently used languages for development due

More information

Java Programming. Manuel Oriol, March 22nd, 2007

Java Programming. Manuel Oriol, March 22nd, 2007 Java Programming Manuel Oriol, March 22nd, 2007 Goal Teach Java to proficient programmers 2 Roadmap Java Basics Eclipse Java GUI Threads and synchronization Class loading and reflection Java Virtual Machines

More information

1B1a Programming I Getting Started

1B1a Programming I Getting Started 1B1a Programming I Getting Started Agenda Definitions. What is programming? What is Java? Writing your first program. Classes and Objects. 1 2 Reading You should be reading chapters 1 & 2 of the text book.

More information

Distributed Technologies - overview & GIPSY Communication Procedure

Distributed Technologies - overview & GIPSY Communication Procedure DEPARTMENT OF COMPUTER SCIENCE CONCORDIA UNIVERSITY Distributed Technologies - overview & GIPSY Communication Procedure by Emil Vassev June 09, 2003 Index 1. Distributed Applications 2. Distributed Component

More information

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS) GETTING STARTED: YOUR FIRST JAVA APPLICATION 15 3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS) GETTING STARTED: YOUR FIRST JAVA APPLICATION Checklist: The most recent version of Java SE Development

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR 2011 2012(ODD SEMESTER) QUESTION BANK SUBJECT CODE / NAME: IT1402-MIDDLEWARE TECHNOLOGIES YEAR/SEM : IV / VII UNIT

More information

DS 2009: middleware. David Evans

DS 2009: middleware. David Evans DS 2009: middleware David Evans de239@cl.cam.ac.uk What is middleware? distributed applications middleware remote calls, method invocations, messages,... OS comms. interface sockets, IP,... layer between

More information

Lecture 06: Distributed Object

Lecture 06: Distributed Object Lecture 06: Distributed Object Distributed Systems Behzad Bordbar School of Computer Science, University of Birmingham, UK Lecture 0? 1 Recap Interprocess communication Synchronous and Asynchronous communication

More information

COMP1007 Principles of Programming

COMP1007 Principles of Programming Agenda COMP1007 Principles of Programming Definitions. What is programming? What is Java? Writing your first program. Classes and Objects. 3 Reading Program You should be reading chapters 1 & 2 of the

More information

Communication Paradigms

Communication Paradigms Communication Paradigms Nicola Dragoni Embedded Systems Engineering DTU Compute 1. Interprocess Communication Direct Communication: Sockets Indirect Communication: IP Multicast 2. High Level Communication

More information

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

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components: Course Snapshot The Next Few Classes We have covered all the fundamental OS components: Architecture and OS interactions Processes and threads Synchronization and deadlock Process scheduling Memory management

More information

Chapter 5 Distributed Objects and Remote Invocation

Chapter 5 Distributed Objects and Remote Invocation CSD511 Distributed Systems 分散式系統 Chapter 5 Distributed Objects and Remote Invocation 吳俊興 國立高雄大學資訊工程學系 Chapter 5 Distributed Objects and Remote Invocation 5.1 Introduction 5.2 Communication between distributed

More information

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

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API Recap: Finger Table Finding a using fingers CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo N102" 86 + 2 4! N86" 20 +

More information

MODELS OF DISTRIBUTED SYSTEMS

MODELS OF DISTRIBUTED SYSTEMS Distributed Systems Fö 2/3-1 Distributed Systems Fö 2/3-2 MODELS OF DISTRIBUTED SYSTEMS Basic Elements 1. Architectural Models 2. Interaction Models Resources in a distributed system are shared between

More information

Distributed Systems Recitation 3. Tamim Jabban

Distributed Systems Recitation 3. Tamim Jabban 15-440 Distributed Systems Recitation 3 Tamim Jabban Project 1 Involves creating a Distributed File System (DFS): FileStack Stores data that does not fit on a single machine Enables clients to perform

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1 OBJECT ORIENTED PROGRAMMING Lecture 14 Networking Basics Outline 2 Networking Basics Socket IP Address DNS Client/Server Networking Class & Interface URL Demonstrating URL Networking 3 Java is practically

More information

Appendix A - Glossary(of OO software term s)

Appendix A - Glossary(of OO software term s) Appendix A - Glossary(of OO software term s) Abstract Class A class that does not supply an implementation for its entire interface, and so consequently, cannot be instantiated. ActiveX Microsoft s component

More information

Course Snapshot. The Next Few Classes

Course Snapshot. The Next Few Classes Course Snapshot We have covered all the fundamental OS components: Architecture and OS interactions Processes and threads Synchronization and deadlock Process scheduling Memory management File systems

More information

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

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development: RMI (Remote Method Invocation) History: Over the year, there have been 3 different approaches to application development: 1. the traditional approach. 2. the client / server approach and 3. the component-

More information

Department of Computer Science & Engineering. M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) Mr.K.

Department of Computer Science & Engineering. M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) Mr.K. Department of Computer Science & Engineering M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) By Mr.K.Yellaswamy Assistant Professor CMR College of Engineering & Technology,

More information

1001ICT Introduction To Programming Lecture Notes

1001ICT Introduction To Programming Lecture Notes 1001ICT Introduction To Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 2, 2015 1 2 Elements of Java Java is a popular, modern, third generation

More information

Chapter 4: Processes

Chapter 4: Processes Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Process Concept An operating

More information

Distributed Objects. Object-Oriented Application Development

Distributed Objects. Object-Oriented Application Development Distributed s -Oriented Application Development Procedural (non-object oriented) development Data: variables Behavior: procedures, subroutines, functions Languages: C, COBOL, Pascal Structured Programming

More information

a translator to convert your AST representation to a TAC intermediate representation; and

a translator to convert your AST representation to a TAC intermediate representation; and CS 301 Spring 2016 Project Phase 3 March 28 April 14 IC Compiler Back End Plan By the end of this phase of the project, you will be able to run IC programs generated by your compiler! You will implement:

More information

Atropos User s manual

Atropos User s manual Atropos User s manual Jan Lönnberg 22nd November 2010 1 Introduction Atropos is a visualisation tool intended to display information relevant to understanding the behaviour of concurrent Java programs,

More information

Array. Prepared By - Rifat Shahriyar

Array. Prepared By - Rifat Shahriyar Java More Details Array 2 Arrays A group of variables containing values that all have the same type Arrays are fixed length entities In Java, arrays are objects, so they are considered reference types

More information

Remote Invocation Vladimir Vlassov and Johan Montelius

Remote Invocation Vladimir Vlassov and Johan Montelius KTH ROYAL INSTITUTE OF TECHNOLOGY Middleware Remote Invocation Vladimir Vlassov and Johan Montelius Application layer Remote invocation / indirect communication Socket layer Network layer ID2201 DISTRIBUTED

More information

S8352: Java From the Very Beginning Part I - Exercises

S8352: Java From the Very Beginning Part I - Exercises S8352: Java From the Very Beginning Part I - Exercises Ex. 1 Hello World This lab uses the Eclipse development environment which provides all of the tools necessary to build, compile and run Java applications.

More information