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

Size: px
Start display at page:

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

Transcription

1 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- based approach. 1. The Traditional Approach. In this approach, there was a single application that handled the presentation logic, business logic and database interactivity.these application also called monolithic application.the drawback of these approach was that if even minor change, extension or enhancement was required in an application, the entire application had to be recompiled and integrated again.

2 2. The Client / Server Approach The client/server architecture, also called the two-tier architecture.in this, data is separated from the client-side and is stored at a centralized location that acts as a server.the business logic is combined with the presentation logic either at the client-side or at the server-side that has the database connectivity code. If the business logic is combined with the presentation logic at the client-side, the client is called a fat client.if the business logic is combined with the database server, the server is called a fat server. Drawbacks: Any change in business polices requires a change in the business logic.to change the business logic, either the presentation logic or the database connectivity code needs to change, depending on the location of the business logic. Application implemented using a two-tier architecture might be difficult to scale-up because of the limited number of database connection available to the client. Connection requests beyond a particular limit are simply rejected by the server. The Component- based Approach. In three-tier, the presentation logic resides at the client side, the database access is controlled by the server-side and the business logic resides between the two layers.this business logic layer is referred to

3 as application server (also called the middle-tier of a componentbased three-tier architecture). Since middle-tier handles the business logic, the work load is balanced between the client, the database server, and the server handling the business logic. The problem with database connection limitation is minimized since the database sees only the business logic layer and not all its client. In the case of a two-tier application, the database connection is established early and is maintained, whereas in a three-tier application,a database connection is established only when data is required and released as soon a the data is retrieved or sent to the server, The applications where the presentation logic, the business logic and the database reside on multiple computers, are called distributed applications Client Application server Database Presentation Server Logic Business Logic A Distributed Application

4 Introduction to RMI: The Java Remote Method Invocation (RMI) system allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine. RMI provides for remote communication between programs written in the Java programming language. RMI is implemented on the middle-tier of the three-tier architecture framework. An Overview of RMI Applications: RMI applications often comprise two separate programs, a server and a client. A typical server program creates some remote objects, makes references to these objects accessible, and waits for clients to invoke methods on these objects. A typical client program obtains a remote reference to one or more remote objects on a server and then invokes methods on them. RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application. Distributed object applications need to do the following: Locate remote objects. Applications can use various mechanisms to obtain references to remote objects. For example, an application can register its remote objects with RMI's simple naming facility, the RMI registry. Alternatively, an application can pass and return remote object references as part of other remote invocations.

5 Communicate with remote objects. Details of communication between remote objects are handled by RMI. To the programmer, remote communication looks similar to regular Java method invocations. Load class definitions for objects that are passed around. Because RMI enables objects to be passed back and forth, it provides mechanisms for loading an object's class definitions as well as for transmitting an object's data. The following illustration depicts an RMI distributed application that uses the RMI registry to obtain a reference to a remote object. The server calls the registry to associate (or bind) a name with a remote object. The client looks up the remote object by its name in the server's registry and then invokes a method on it. The illustration also shows that the RMI system uses an existing web server to load class definitions, from server to client and from client to server, for objects when needed. Advantages of Dynamic Code Loading: One of the central and unique features of RMI is its ability to download the definition of an object's class if the class is not defined in the receiver's Java virtual machine. All of the types and behavior of an object, previously available only in a single Java virtual machine, can

6 be transmitted to another, possibly remote, Java virtual machine. RMI passes objects by their actual classes, so the behavior of the objects is not changed when they are sent to another Java virtual machine. This capability enables new types and behaviors to be introduced into a remote Java virtual machine, thus dynamically extending the behavior of an application. The compute engine example in this trail uses this capability to introduce new behavior to a distributed program. Remote Interfaces, Objects, and Methods: Like any other Java application, a distributed application built by using Java RMI is made up of interfaces and classes. The interfaces declare methods. The classes implement the methods declared in the interfaces and, perhaps, declare additional methods as well. In a distributed application, some implementations might reside in some Java virtual machines but not others. Objects with methods that can be invoked across Java virtual machines are called remote objects. An object becomes remote by implementing a remote interface, which has the following characteristics: A remote interface extends the interface java.rmi.remote. Each method of the interface declares java.rmi.remoteexception in its throws clause, in addition to any application-specific exceptions. RMI treats a remote object differently from a non-remote object when the object is passed from one Java virtual machine to another Java virtual machine. Rather than making a copy of the implementation object in the receiving Java virtual machine, RMI passes a remote stub for a remote object. The stub acts as the local representative, or

7 proxy, for the remote object and basically is, to the client, the remote reference. The client invokes a method on the local stub, which is responsible for carrying out the method invocation on the remote object. A stub for a remote object implements the same set of remote interfaces that the remote object implements. This property enables a stub to be cast to any of the interfaces that the remote object implements. However, only those methods defined in a remote interface are available to be called from the receiving Java virtual machine. Creating Distributed Applications by Using RMI Using RMI to develop a distributed application involves these general steps: 1.Designing and implementing the components of your distributed application. 2.Compiling sources. 3.Making classes network accessible. 4.Starting the application. 1.Designing and Implementing the Application Components: First, determine your application architecture, including which components are local objects and which components are remotely accessible.

8 This step includes: Defining the remote interfaces.a remote interface specifies the methods that can be invoked remotely by a client. Clients program to remote interfaces, not to the implementation classes of those interfaces. The design of such interfaces includes the determination of the types of objects that will be used as the parameters and return values for these methods. If any of these interfaces or classes do not yet exist, you need to define them as well. Implementing the remote objects. Remote objects must implement one or more remote interfaces. The remote object class may include implementations of other interfaces and methods that are available only locally. If any local classes are to be used for parameters or return values of any of these methods, they must be implemented as well. Implementing the clients. Clients that use remote objects can be implemented at any time after the remote interfaces are defined, including after the remote objects have been deployed. 2.Compiling Sources: As with any Java program, you use the javac compiler to compile the source files. The source files contain the declarations of the remote interfaces, their implementations, any other server classes, and the client classes. 3.Making Classes Network Accessible:

9 In this step, you make certain class definitions network accessible, such as the definitions for the remote interfaces and their associated types, and the definitions for classes that need to be downloaded to the clients or servers. Classes definitions are typically made network accessible through a web server. 4.Starting the Application: Starting the application includes running the RMI remote object registry, the server, and the client. The rest of this section walks through the steps used to create a compute engine. Building a Generic Compute Engine This trail focuses on a simple, yet powerful, distributed application called a compute engine. The compute engine is a remote object on the server that takes tasks from clients, runs the tasks, and returns any results. The tasks are run on the machine where the server is running. This type of distributed application can enable a number of client machines to make use of a particularly powerful machine or a machine that has specialized hardware. The novel aspect of the compute engine is that the tasks it runs do not need to be defined when the compute engine is written or started. New kinds of tasks can be created at any time and then given to the compute engine to be run. The only requirement of a task is that its class implement a particular interface. The code needed to accomplish the task can be downloaded by the RMI system to the compute

10 engine. Then, the compute engine runs the task, using the resources on the machine on which the compute engine is running. The ability to perform arbitrary tasks is enabled by the dynamic nature of the Java platform, which is extended to the network by RMI. RMI dynamically loads the task code into the compute engine's Java virtual machine and runs the task without prior knowledge of the class that implements the task. Such an application, which has the ability to download code dynamically, is often called a behavior-based application. Such applications usually require full agent-enabled infrastructures. With RMI, such applications are part of the basic mechanisms for distributed computing on the Java platform. Components of RMI Application A distributed RMI application has two components: 1. RMI Server 2. RMI Client The RMI server contains the objects whose methods are to be invoked remotely. The server creates several remote objects and makes a reference of these objects in the RMI registry. The RMI registry is a service that runs on the RMI server. The client get the reference of one or more remote objects from the RMI registry be looking up the object name.

11 Functionality of Application in RMI Client RMI registry Server Once the client gets the reference of the remote object, the methods in the remote object are invoked just like the methods of a local object. The difference cannot be identified in terms of whether the methods are invoked on the remote object or are invoked on the local objects in the client. The RMI Architecture Stubs and skeletons The RMI architecture consists of three layers : 1. Stub / Skeleton layer 2. Remote Reference layer (RRL) 3. Transport layer 1.Stub / Skeleton Layer:

12 The Stub / Skeleton layer listens to remote method calls made be the client and redirects these calls to the RMI services on the server. To invoke methods of a remote object,the request on the client-side starts with a stub. A stub is a client-side proxy representing remote object. The stub communicates the method invocations to the remote objects through a skeleton that is implemented on the server. The skeleton is a server-side proxy that continues communication with the stub by: 1. Reading the parameters for the method calls. 2. Making the call to the remote service implementation object. 3. Accepting the return value. 4. Writing the return value back to the stub. 2.Remote Reference Layer (R R L): The RRL interprets and manages the references made by client to remote object on a server.the RRL on the client-side receives a request for methods from a stub that is transferred as a marshaled stream of data to the RRL on a server-side.marshalling is a process in which parameters passed by a client are converted to a format that can be transferred across network.

13 The server-side RRL unmarshals the parameters that are sent to a remote method through the skeleton.unmarshaling is a process in which the marshaled parameters passed by the client-side RRL through the server-side RRL are converted to a format that the skeleton understands.while returning a value from the skeleton, the data is again marshaled and communicated to the client through the server-side RRL. 3.Transport Layer: The transport layer is a link between the RRL on the sever-side and the RRL on the client-side.the transport layer is a responsible for setting up new connections and managing existing connections.it is also responsible for handling remote objects that are residing in a transport layer address space. The following steps explain how the client is connected to the server: 1. On receiving a request from the client-side RRL,the transport layer establishes a socket connection to the server through a serverside RRL. 2. Then, the transport layer passes the established connection to the client-side RRL and adds a remote reference to the connection in its table.

14 R M I Packages Java provides the following packages for R M I : 1. The java.rmi package provides the Remote interface, a class for accessing the remote names registered on the server, and a security manager for RMI. 2. The java.rmi.registry package provides classes and interfaces that are used be the remote registry. 3. The java.rmi.server package provides classes and interfaces used to implement remote objects, stub and skeletons and support for RMI. 4. The java.rmi.dgc package provides classes and interface that are used by the RMI-distributed garbage collector. Creating a Distributed Application Using RMI According to RMI specifications,you need to follow certain steps to create a distributed RMI application. The Steps are as follows: 1. Create a remote interface. 2. Implement the remote interface. 3. Create an RMI server 4. Create an RMI Client.

15 5. Run the RMI Application. 1. Create a remote interface: A remote interface specifies the methods that can be invoked remotely by the client. Remote interfaces have the following characteristics: 1. A remote interface must be declared public. 2. A remote interface extends the java.rmi.remote interface. 3. Each method must declare java.rmi.remoteexception in its throw clause to trap network connection and server problems. import java.rmi.*; public interface Hello extends Remote public String sayhello() throws RemoteException; 2. Implement the remote interface: You need to implement the remote interface to create a remote service class that provides information about server objects. The remote service class defines all the methods that are declared in the remote interface. import java.rmi.*;

16 import java.rmi.server.*; Hello public class HelloImpl extends UnicastRemoteObject implements public HelloImpl() throws RemoteException super(); public String sayhello() throws RemoteException return Hello! Brothers. ; The remote service class extends the UnicastRemoteObject class for implementing a method of remote interface. The UnicastRemoteObject class extends the RemoteServer class of java.rmi and defines all the methods of the RemoteServer class. The remote object instance needs to be exported. This enables the remote object to accept remote method requests by listening at a particular port. Since the HelloImpl class extends the UnicastRemoteObject class, it is exported, automatically.

17 If your implementation class already extends a class other than UnicastRemoteObject, you need to explicitly export the remote object by calling the UnicastRemoteObject.exportObject() method from the constructor of the implementation class. 3. Create an RMI server: The RMI server class contains server objects that are invoked be the client remotely. You need to create the object of the remote service class in the main method of the RMI server class to create the server object. You need to register the server object in the registry before the server object is ready to accept request from the client The setsecuritymanager() method of SecurityManager class is used in the server class to set the security manager for the RMI application, so any unauthorized client cannot invoke the server object. To authenticate a RMI client, you need to create the security policy file that contains all the required permissions. import java.rmi.*; import java.rmi.server.*; public class HelloServer

18 public static void main(string arg[]) try System.setSecurityManager(new RMISecurityManager()) ; Hello h = new HelloImpl(); // Bind the remote object to the RMI registry Naming.rebind( server,h); System.out.println( Object is registered..wating for client.. ); catch(exception e) System.out.println( Error: + e); 4. Create an RMI Client: The client uses a stub object to access the remote object that exists on the server. You specify the name of the server object in the lookup() method of the java.rmi.naming class to find the tub object.

19 import java.rmi.*; public class HelloClient public static void main(string args[]) try // Find the remote object in the RMI registry Hello h = (Hello)Naming.lookup( rmi://localhost/server ); System.out.println( Server : + h.sayhello()); catch(exception e) System.out.println( Error : + e); 5. Run the RMI Application: After compiling the java source files, you need to generate stub and skeleton that communicates between client and server.

20 You need to register server objects to RMI registry before you run the RMI application. The steps to run an RMI application are: 1.Generate the stub and skeleton of the remote service class. 2.Start the RMI registry. 3.Run the RMI server of distributed application. 4.Run the RMI client of distributed application. 1. Generate the stub and skeleton of the remote service class: The RMI compiler, rmic compiles the remote service class that implements the remote interface and generates the stub and skeleton. The stub enables the client to communicate with a particular remote object. The skeleton represents the object of client that is located on the remote host. The command to generate the stub and skeleton for an RMI application: rmic HelloImpl 2. RMI registry: To start the RMI Registry on the Server, execute the start rmiregistry command at the command prompt.

21 By dafault, the registry runs on port To start the RMI Registry on a diferent port, you need to specify the port number on the command line as follows: start rmiregistry 1234 You must stop and restart the rmiregistry service whenever you modify the remote interface. 3. Run the RMI server of distributed application: You need to start the server to service the client requests. The command to run the HelloServer RMI server is : java HelloServer 4. Run the RMI client of distributed application: The command to run the RMI client is : java HelloClient If you are running a client from the same computer, give the command from a separate command prompt window.

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

Remote Method Invocation

Remote Method Invocation Remote Method Invocation A true distributed computing application interface for Java, written to provide easy access to objects existing on remote virtual machines Provide access to objects existing on

More information

Remote Method Invocation in Java

Remote Method Invocation in Java Remote Method Invocation in Java Ajay Khatri Senior Assistant Professor,Department IT Acropolis Institute of Technology & Research ajay.acropolis@gmail.com What is RMI RMI is an API that provides a mechanism

More information

Last Class: Network Overview. Today: Distributed Systems

Last Class: Network Overview. Today: Distributed Systems Last Class: Network Overview =>Processes in a distributed system all communicate via a message exchange. Physical reality: packets Abstraction: messages limited size arbitrary size unordered (sometimes)

More information

Distributed Computing

Distributed Computing Distributed Computing Computing on many systems to solve one problem Why? - Combination of cheap processors often more cost-effective than one expensive fast system - Flexibility to add according to needs

More information

RMI. Remote Method Invocation. 16-Dec-16

RMI. Remote Method Invocation. 16-Dec-16 RMI Remote Method Invocation 16-Dec-16 The network is the computer Consider the following program organization: method SomeClass call AnotherClass returned object computer 1 computer 2 If the network is

More information

Written by: Dave Matuszek

Written by: Dave Matuszek RMI Remote Method Invocation Written by: Dave Matuszek appeared originally at: http://www.cis.upenn.edu/~matuszek/cit597-2003/ 28-May-07 The network is the computer * Consider the following program organization:

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

CSci Introduction to Distributed Systems. Communication: RPC In Practice

CSci Introduction to Distributed Systems. Communication: RPC In Practice CSci 5105 Introduction to Distributed Systems Communication: RPC In Practice Linux RPC Language-neutral RPC Can use Fortran, C, C++ IDL compiler rpgen N to generate all stubs, skeletons (server stub) Example:

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

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

JAVA RMI Java, summer semester

JAVA RMI Java, summer semester JAVA RMI Overview Remote Method Invocation usage of remote object objects in a different VM (on the same computer or over the network) as there would be local objects (almost) calls just take longer time

More information

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

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI 03 Remote invocation Request-reply RPC Coulouris 5 Birrel_Nelson_84.pdf RMI 2/16 Remote Procedure Call Implementation client process Request server process client program client stub procedure Communication

More information

Distributed Systems COMP 212. Lecture 10 Othon Michail

Distributed Systems COMP 212. Lecture 10 Othon Michail Distributed Systems COMP 212 Lecture 10 Othon Michail RMI: Remote Method Invocation Allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine.

More information

Component-Based Software Engineering

Component-Based Software Engineering Component-Based Software Engineering Remote Method Invocation Paul Krause Introduction to RMI Lecture 11 - RMI Simple Example - DivideServer Demo of this example Review a more complex example - StudentEnrollment

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

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

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 Distributed Systems 02r. Java RMI Programming Tutorial Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 1 Java RMI RMI = Remote Method Invocation Allows a method to be invoked that resides

More information

Lab 2 : Java RMI. request sayhello() Hello interface remote object. local object. response "Hello world"

Lab 2 : Java RMI. request sayhello() Hello interface remote object. local object. response Hello world Lab 2 : Java RMI 1. Goals In this lab you will work with a high-level mechanism for distributed communication. You will discover that Java RMI provides a mechanism hiding distribution in OO programming.

More information

presentation DAD Distributed Applications Development Cristian Toma

presentation DAD Distributed Applications Development Cristian Toma Lecture 8 S4 - Core Distributed Middleware Programming in JEE presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department of Economic Informatics & Cybernetics www.dice.ase.ro

More information

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

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture session Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano RMI Remote Method Invocation Introduction Java RMI let s work calling remote methods. Underneath it works with

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

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

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

Remote Method Invocation

Remote Method Invocation Non-101samples available here: https://github.com/101companies/101repo/tree/master/languages/aspectj/javarmisamples Remote Method Invocation Prof. Dr. Ralf Lämmel Universität Koblenz-Landau Software Languages

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

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

RMI Case Study. A Typical RMI Application

RMI Case Study. A Typical RMI Application RMI Case Study This example taken directly from the Java RMI tutorial http://java.sun.com/docs/books/tutorial/rmi/ Editorial note: Please do yourself a favor and work through the tutorial yourself If you

More information

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

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine. Q.1) What is Remote method invocation (RMI)? A. RMI allows us to invoke a method of java object that executes on another machine. B. RMI allows us to invoke a method of java object that executes on another

More information

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

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma Distributed and Agent Systems RMI Prof. Agostino Poggi What is RMI? Its acronym means Remote

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 [RMI] Frequently asked questions from the previous class survey Shrideep Pallickara Computer Science Colorado State University L21.1 L21.2 Topics covered in this lecture RMI

More information

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

Distributed Systems. 6. Remote Method Invocation. Werner Nutt Distributed Systems 6. Remote Method Invocation Werner Nutt 1 Remote Method Invocation 6.1 Communication between Distributed Objects 1. Communication between Distributed Objects 2. Java RMI 3. Dynamic

More information

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

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414 The UNIVERSITY of EDINBURGH SCHOOL of INFORMATICS CS4/MSc Distributed Systems Björn Franke bfranke@inf.ed.ac.uk Room 2414 (Lecture 3: Remote Invocation and Distributed Objects, 28th September 2006) 1 Programming

More information

RMI. (Remote Method Invocation)

RMI. (Remote Method Invocation) RMI (Remote Method Invocation) Topics What is RMI? Why RMI? Architectural components Serialization & Marshaled Objects Dynamic class loading Code movement Codebase ClassLoader delegation RMI Security Writing

More information

IBD Intergiciels et Bases de Données

IBD Intergiciels et Bases de Données IBD Intergiciels et Bases de Données RMI-based distributed systems Fabien Gaud, Fabien.Gaud@inrialpes.fr Overview of lectures and practical work Lectures Introduction to distributed systems and middleware

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

DIFFERENCE BETWEEN APPLET AND APPLICATION

DIFFERENCE BETWEEN APPLET AND APPLICATION Module 4 Network Programming with Java - *Features of Java Applets & Application Life cycle of applets - Security features for applets - Inter applet communication *Threads & Thread synchronization TCP/IP

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

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

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

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course JAC444 - Lecture 11 Remote Method Invocation Segment 2 - Develop RMI Application 1 Remote Method Invocation In this lesson you will be learning about: Designing RMI application Developing distributed object

More information

RMI Example RMI. CmpE 473 Internet Programming RMI

RMI Example RMI. CmpE 473 Internet Programming RMI CmpE 473 Internet Programming Pınar Yolum pinar.yolum@boun.edu.tr Department of Computer Engineering Boğaziçi University RMI Examples from Advanced Java: Internet Applications, Art Gittleman Remote Method

More information

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

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University Communication Basics, RPC & RMI CS403/534 Distributed Systems Erkay Savas Sabanci University 1 Communication Models 1. Remote Procedure Call (RPC) Client/Server application 2. Remote Method Invocation

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 Method Invocation

Remote Method Invocation Remote Method Invocation RMI Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in 1 Agenda Introduction Creating

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

Remote Method Invocation R.M.I.

Remote Method Invocation R.M.I. Distributed Computing Remote Method Invocation R.M.I. Gheorghe Aurel Pacurar Distributed Computing using RMI Remote Method Invocation (RMI) allows object-to-object communication between different Java

More information

COMP 6231: Distributed System Design

COMP 6231: Distributed System Design COMP 6231: Distributed System Design Remote Invocation and RMI Based on Chapters 5, 7 of the text book and the slides from Prof. M.L. Liu, California Polytechnic State University COMP 6231, Fall 2013 Remote

More information

How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader

How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader 36 ClassLoader How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader... and when? - When they are needed the first time. class

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

SUMMARY INTRODUCTION REMOTE METHOD INVOCATION

SUMMARY INTRODUCTION REMOTE METHOD INVOCATION SUMMARY REMOTE METHOD INVOCATION PROGRAMMAZIONE CONCORRENTE E DISTR. Università degli Studi di Padova Dipartimento di Matematica Corso di Laurea in Informatica, A.A. 2015 2016 rcardin@math.unipd.it Introduction

More information

Lecture VI: Distributed Objects. Remote Method Invocation

Lecture VI: Distributed Objects. Remote Method Invocation Lecture VI: Distributed Objects. Remote Method Invocation CMPT 401 Summer 2007 Dr. Alexandra Fedorova Remote Method Invocation In an object-oriented language (usually Java) A way to call a method on an

More information

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void 1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void addtemperaturelistener ( TemperatureListener listener ) 5 throws

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

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

Advanced Java Programming

Advanced Java Programming Advanced Java Programming Length: 4 days Description: This course presents several advanced topics of the Java programming language, including Servlets, Object Serialization and Enterprise JavaBeans. In

More information

Distributed Software Systems

Distributed Software Systems RMI Programming Distributed Software Systems RMI Programming RMI software Generated by IDL compiler Proxy Behaves like remote object to clients (invoker) Marshals arguments, forwards message to remote

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

Grid Computing. Java Remote Method Invocation (RMI) RMI Application. Grid Computing Fall 2006 Paul A. Farrell 9/5/2006

Grid Computing. Java Remote Method Invocation (RMI) RMI Application. Grid Computing Fall 2006 Paul A. Farrell 9/5/2006 Grid Computing Paradigms for Distributed Computing 2 RMI Fall 2006 Traditional paradigms for distributed computing The Grid: Core Technologies Maozhen Li, Mark Baker John Wiley & Sons; 2005, ISBN 0-470-09417-6

More information

#,!" $* ( #+,$ $$ $# -.,$ / 0' ".12 $ $$ 5/ #$" " " $ $ " # $ / 4 * # 6/ 8$8 ' # 6 $! 6$$ #$ * $ $$ ** 4 # 6 # * 0; & *! # #! #(' 7 / $#$ -.

#,! $* ( #+,$ $$ $# -.,$ / 0' .12 $ $$ 5/ #$   $ $  # $ / 4 * # 6/ 8$8 ' # 6 $! 6$$ #$ * $ $$ ** 4 # 6 # * 0; & *! # #! #(' 7 / $#$ -. ! " $ %&(& $ $ $* ( +,$ $$ $ -.,$ / 0 ".12 ) ($$ ( 4, /!" ($$ ( 4, / 4 0 ($ $ $ $ $$ 5/ $" " " $ $ " $ / 4 * %!&& $ $$ ** 4 6 7$ 4 0 %!&& $ 88 $ 6 67 $ / ** 7$ 4.12 )*&$& 6/ 8$8 6 $! 6$$ $ * 67$ : $* $

More information

Remote Method Invocation Benoît Garbinato

Remote Method Invocation Benoît Garbinato Remote Method Invocation Benoît Garbinato 1 Fundamental idea (1) Rely on the same programming paradigm for distributed applications as for centralized applications In procedural languages, we will rely

More information

Remote Method Invocation. Benoît Garbinato

Remote Method Invocation. Benoît Garbinato Remote Method Invocation Benoît Garbinato Fundamental idea (1) Rely on the same programming paradigm for distributed applications as for centralized applications In procedural languages, we will rely on

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

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

IJESRT. http: //

IJESRT. http: // IJESRT [Monika,1(4): Jun., 2012] INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY Innovative Techniquee of Message Passing In Loosely Coupled System Monika Arya* Department of Computer

More information

EAST WEST UNIVERSITY

EAST WEST UNIVERSITY EAST WEST UNIVERSITY RMI Based Distributed Query Processing Submitted By Avirupa Roy Talukder ID: 2011-2-60-001 Alok Kumar Roy ID: 2011-2-60-045 Supervised by Dr. Shamim Akhter Assistant Professor Department

More information

Activation of remote objects

Activation of remote objects Activation of remote objects The Activatable class Prior to the release of Java 2 SDK, an instance of a UnicastRemoteObject could be accessed from a server program that created an instance of the remote

More information

Distributed Objects SPL/ SPL 201 / 0 1

Distributed Objects SPL/ SPL 201 / 0 1 Distributed Objects 1 distributed objects objects which reside on different machines/ network architectures, benefits, drawbacks implementation of a remote object system 2 Why go distributed? large systems

More information

A Typical RMI Application

A Typical RMI Application A Typical RMI Application Client and Server run on different machines Remote Object(s) registered in rmiregistry by Server Remote Object(s) look d up by Client When necessary, code transferred from web

More information

BEA WebLogic. Server. Programming WebLogic RMI

BEA WebLogic. Server. Programming WebLogic RMI BEA WebLogic Server Programming WebLogic RMI Release 8.1 Document Revised: December 5, 2002 Copyright Copyright 2002 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software and documentation

More information

A Typical RMI Application. Case Study

A Typical RMI Application. Case Study A Typical RMI Application Client and Server run on different machines Remote Object(s) registered in rmiregistry by Server Remote Object(s) look d up by Client When necessary, code transferred from web

More information

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

4:40pm - 6:10pm (90 min) CMPT-401 Operating Systems II (Fall 2005) Midterm School of Computing Science Simon Fraser University October 18, 2005 4:40pm - 6:10pm (90 min) Last name: First name: Student number: Signature: Note: 1.

More information

Distributed Programming with RMI. Overview CORBA DCOM. Prepared By: Shiba R. Tamrakar

Distributed Programming with RMI. Overview CORBA DCOM. Prepared By: Shiba R. Tamrakar Distributed Programming with RMI Overview Distributed object computing extends an object-oriented programming system by allowing objects to be distributed across a heterogeneous network, so that each of

More information

Reflection/RMI 4/28/2009

Reflection/RMI 4/28/2009 Reflection/RMI 4/28/2009 1 Opening Discussion Solutions to the interclass problem. Do you have any questions about the assignment? Minute Essays Why are heap operations always O(log n)? Java programs connecting

More information

Distributed Programming in Java. Distribution (2)

Distributed Programming in Java. Distribution (2) Distributed Programming in Java Distribution (2) Remote Method Invocation Remote Method Invocation (RMI) Primary design goal for RMI is transparency Should be able to invoke remote objects with same syntax

More information

BEA WebLogic Server. Programming WebLogic RMI

BEA WebLogic Server. Programming WebLogic RMI BEA WebLogic Server Programming WebLogic RMI BEA WebLogic Server 6.1 Document Date: June 24, 2002 Copyright Copyright 2002 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software

More information

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

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 4.3 Remote procedure calls RPC flow Client process Server process Program i = sum (3,7); Procedure sum (j,k) int j,k; {return j+k; Client stub Program Return Call Unpack Pack result para s Invisible to

More information

Firewall Issues. The possible scenarios: the RMI client, the server, or both can be operating from behind a firewall

Firewall Issues. The possible scenarios: the RMI client, the server, or both can be operating from behind a firewall Firewall Issues Firewalls are inevitably encountered by any networked enterprise application that has to operate beyond the confines of an Intranet Typically, firewalls block all network traffic, with

More information

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

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

More information

Info 408 Distributed Applications programming 2 nd semester of Credits: 5 Lecturer: Antoun Yaacoub Ph.D.

Info 408 Distributed Applications programming 2 nd semester of Credits: 5 Lecturer: Antoun Yaacoub Ph.D. Lebanese University Faculty of Sciences I Master 1 degree Computer Sciences Info 408 Distributed Applications programming 2 nd semester of 2018-2019 Credits: 5 Lecturer: Antoun Yaacoub Ph.D. RMI Serialization

More information

6 Distributed Object-Based Systems

6 Distributed Object-Based Systems CA464: DISTRIBUTED PROGRAMMING 1 6 Distributed Object-Based Systems 6.1 Architecture Remote distributed objects Data and operations encapsulated in an object Operations implemented as methods grouped into

More information

CC755: Distributed and Parallel Systems

CC755: Distributed and Parallel Systems CC755: Distributed and Parallel Systems Dr. Manal Helal, Spring 2016 moodle.manalhelal.com Lecture 7: Remote Method Invocation (RMI) 1 RMI Y Daniel Liang, Introduction to JAVA Programming, 9th Edition,

More information

Chapter 4: Processes. Process Concept. Process State

Chapter 4: Processes. Process Concept. Process State 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

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

Applications. RMI, RPC and events. Request reply protocol External data representation. Operating System 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

More information

Modulo II Socket, RMI e Corba

Modulo II Socket, RMI e Corba Modulo II Socket, RMI e Corba Prof. Ismael H F Santos April 05 Prof. Ismael H. F. Santos - ismael@tecgraf.puc-rio.br 1 Ementa Sistemas Distribuídos Cliente-Servidor April 05 Prof. Ismael H. F. Santos -

More information

REMOTE METHOD INVOCATION INTRODUCTION TO RMI, A JAVA API FOR RPC-STYLE INVOCATION OF REMOTE OBJECT METHODS

REMOTE METHOD INVOCATION INTRODUCTION TO RMI, A JAVA API FOR RPC-STYLE INVOCATION OF REMOTE OBJECT METHODS RMI Remote Method RMI Invocation REMOTE METHOD INVOCATION INTRODUCTION TO RMI, A JAVA API FOR RPC-STYLE INVOCATION OF REMOTE OBJECT METHODS Peter R. Egli 1/19 Contents 1. What is RMI? 2. Important RMI

More information

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

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP) 55:182/22C:182 Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP) Broker Architecture Example Java Remote Method Invocation (RMI) Invoking a method which lies in a different address

More information

COMP 6231 Distributed Systems Design. Tutorial 2 by Alexandre Hudon January 21 st, 2013

COMP 6231 Distributed Systems Design. Tutorial 2 by Alexandre Hudon January 21 st, 2013 COMP 6231 Distributed Systems Design Tutorial 2 by Alexandre Hudon January 21 st, 2013 Agenda 1. Assignment #1 Discussion (~30mins) 2. Java RMI (1h20) 1. Basic concepts 2. Installing Java RMI 3. Exercises

More information

Sockets and RMI. CS151 Chris Pollett Dec. 5, 2005.

Sockets and RMI. CS151 Chris Pollett Dec. 5, 2005. Sockets and RMI CS151 Chris Pollett Dec. 5, 2005. Outline Echo Server with Multiple Clients Client pull/server push Remote Method Invocation Proxy Pattern Echo Server with Multiple Clients public class

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 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

Activation of remote objects

Activation of remote objects Activation of remote objects The Activatable class Prior to the release of Java 2 SDK, an instance of a UnicastRemoteObject could be accessed from a server program that created an instance of the remote

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

Bharati Vidyapeeth s Institute of Computer Applications and Management A-4, Paschim Vihar, New Delhi-63.

Bharati Vidyapeeth s Institute of Computer Applications and Management A-4, Paschim Vihar, New Delhi-63. Bharati Vidyapeeth s Institute of Computer Applications and Management A-4, Paschim Vihar, New Delhi-63. MCA III rd Semester Second Internal: Java Programming (MCA-205) Note: All the questions are compulsory.

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

THE RMI PROXY USER GUIDE

THE RMI PROXY USER GUIDE THE RMI PROXY USER GUIDE Copyright Telekinesis Pty Ltd, 2000, 2002. All rights reserved. 1 Introduction Java RMI allows Java programs executing within different Java Virtual Machines to communicate using

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

Lecture 18 Inside Java RMI

Lecture 18 Inside Java RMI CMSC 433 Fall 2014 Sec/on 0101 Mike Hicks (slides due to Rance Cleaveland) Lecture 18 Inside Java RMI Recall Java RMI applica/ons consist of three en//es Remote object servers Host remote objects Handle

More information

Web. Remote Method Invocation. core. programming. Training Courses: Java, JSP, Servlets, Struts, & JSF:

Web. Remote Method Invocation. core. programming. Training Courses: Java, JSP, Servlets, Struts, & JSF: core Web programming Remote Method Invocation 1 Training Courses: Java, JSP, Servlets, Struts, & JSF: http://courses.coreservlets.com 2001-2004 Marty Hall, Larry Brown http:// Agenda Steps to build an

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

Remote Method Invocation Java RMI & Web-Services

Remote Method Invocation Java RMI & Web-Services Remote Method Invocation Java RMI & Web-s CS 4119 - Computer Networks Columbia University - Spring 2003 Alexander V. Konstantinou akonstan@cs.columbia.edu Introduction : Remote Computation Objects encapsulate

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