What is RMI? Remote Method Invocation

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

Remote Method Invocation CS587x Lecture Department of Computer Science Iowa State University.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Remote Method Invocation
Company LOGO Remote Method Invocation Georgi Cholakov, Emil Doychev, University of Plovdiv “Paisii.
FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Advanced Java Class Network Programming. Network Protocols Overview Levels of Abstraction –HTTP protocol: spoken by Web Servers and Web Clients –TCP/IP:
1 HANDOUT 14 Remote Method Invocation (RMI) BY GEORGE KOUTSOGIANNAKIS THIS DOCUMENT CAN NOT BE REPRODUCED OR DISTRIBUTED WITHOUT TH E WRITTEN PERMISSION.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
Introduction to Remote Method Invocation (RMI)
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry:
1 Java Programming II Java Network II (Distributed Objects in Java)
+ A Short Java RMI Tutorial Usman Saleem
1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. With Thanks to.
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
Silberschatz, Galvin, and Gagne  1999 Applied Operating System Concepts Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote.
Java Remote Method Invocation RMI. Idea If objects communicate with each other on one JVM why not do the same on several JVM’s? If objects communicate.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
Java Distributed Object Model A remote object is one whose methods can be invoked from another JVM on a different host. It implements one or more remote.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Distributed Computing
Java Distributed Computing
Java Remote Method Invocation (RMI)
Broker in practice: Middleware
Remote Method Invocation
Java RMI CS-328 Internet Programming.
Remote Method Invocation
Network and Distributed Programming in Java
Creating a Distributed System with RMI
Chapter 40 Remote Method Invocation
Creating a Distributed System with RMI
Overview of RMI Architecture
Remote Method Invocation
Creating a Distributed System with RMI
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Java Remote Method Invocation
Creating a Distributed System with RMI
Overview of RMI Architecture
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

What is RMI? Remote Method Invocation A true distributed computing application interface for Java, written to provide easy access to objects existing on remote virtual machines Helps provide access to objects existing on remote virtual machines

What is RMI? cont. Remote Method Invocation Remote objects can be treated similarly to local objects Handles marshalling, transportation, and garbage collection of the remote objects Became part of the JDK with version 1.1

What is RMI not? Not an all-purpose ORB architecture like CORBA and DCOM Not language independent Limited only to Java Interfaces to remote objects are defined using ordinary Java interfaces (rather than having to use a special purpose interface definition language) Can provide more advanced features like serialization and security

Support for the interface

Interface Support Layers Stub/skeleton layer Responsible for managing the remote object interface between the client and server Remote reference layer Responsible for managing the "liveliness" of the remote objects Manages the communication between the client/server and virtual machines

Interface Support Layers, cont. Transport layer Actual network/communication layer that is used to send the information between the client and server over the wire Currently TCP/IP based Uses serialization and remote procedure call to send information back and forth between remote objects

Interface Support Layers, cont. Transport layer uses a hierarchy Initially tries to establish an ordinary socket connection between client and host If that fails, it tries HTTP Finally, it will try to use a cgi-script on the server and POST the data

Create the Interface Definition First thing: define the interface Interface defines what remote methods and variables are going to be exported from the remote object. Remote interface must adhere to certain limitations: must be public must import the java.rmi.* package must extend the java.rmi.Remote interface

Create the Interface Definition Limitations, cont.: all exported methods must throw an RMI remote exception to manage errors during invocation all references to remote objects must be references to the interface (not to the remote object itself)

Implement the Interface Definition Next, implement the remote interface Limitations: must implement at least one remote interface must import the java.rmi.server.* package must extend java.rmi.server.UnicastRemoteObject must install a security manager must create at least one instance of a remote object (for instance itself) must register at least one of the remote objects with the RMI remote object registry

Creating the Stubs/Skeletons Stubs and skeleton code generated by using the rmic compiler rmic compiler creates stub and skeleton classes *_Stub and *_Skel classes are where the references to the remote objects will resolve to in the client's address space RRL will manage the mapping of these objects to the server's address space

Client Must import java.rmi package and java.rmi.RMISecurityManager Client must register with a security manager RMI Security Manager Constitutes the “sandbox” where Java applets reside Loading of classes Classes loaded from the network cannot be trusted If no security manager exists, only classes from the local file system will be loaded

Client, cont. After registering the security manager create a URL string that is comprised of the server name and remote object name you are requesting rmi://my.host.edu/myServer “myServer” is the remote object enables the client to look up the remote object on the server via the rmiregistry

Client, cont. Once the remote reference is made Client can invoke remote methods on the remote object The remote object is then treated as if it were a local object

Server Has the same requirements as the client regarding the security manager Once the server has registered with the security manager, it must create an instance of the remote object it wants to export

Server, cont. RMIRegistry Must be running on the server Objects registered through this Clients are given access to remote objects through this Since the server uses the rmiregistry, you must bind (i.e., alias) an instance of the object with the name that will be used to look up the object

The future of RMI Now that it is part of JDK1.1, it is highly unlikely that it will be removed at a later date. According to Sun, RMI has not been (and will not be) replaced by Corba and IIOP. According to JavaSoft, RMI will be extended in the future with the ability to use IIOP as a transport protocol

Sources http://www.edm2.com/0601/rmi1.html http://www.daimi.aau.dk/%7Ebouvin/otw/rmidescription.html http://java.sun.com/products/jdk/1.1/docs/guide/rmi/spec/rmi-objmodel.doc.html#167