RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
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.
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
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.
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
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.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Java RMI RMI = Remote Method Invocation. Allows Java programs to invoke methods of remote objects. Only between Java programs. Several versions (JDK-1.1,
Internet Software Development Remote Method Invocation Paul Krause.
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)
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
+ A Short Java RMI Tutorial Usman Saleem
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
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 Continued IS Outline  Review of RMI  Programming example.
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.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
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.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
 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.
Khoa CNTT 1/37 PHẠM VĂN TÍNH   Java 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.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
Netprog Java RMI1 Remote Method Invocation.
1 RPCs and Naming G53ACC Chris Greenhalgh. 2 Contents l Naming principles l Advantages l Patterns of use l Implementation issues l Examples l RMI registry.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Chapter 4 Remote Method Invocation
Principles of Software Development
Java Distributed Computing
Java Remote Method Invocation (RMI)
Remote Method Invocation
What is RMI? Remote Method Invocation
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
Remote method invocation (RMI)
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
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between different JVM. RMI Client Remote Object or RMI server Remote Method Call

RMI provides basic infrastructure required for distributed computing. Commonly used terms or terminology of RMI. 1) Remote object / RMI server :- A remote object /RMI server is a distributed object that exposes remote method which can be invoke on the remote object in a distributed manner from different JVM. 2) RMI client: is an object that invokes a remote method using RMI.

Domain name Server Domain Name Web Application Web Server ISP Client 1.1 domains name are provided 1.0 registered IP Address

3) Stub :- A stub represents a proxy of remote object that hides the internal details of remote method invocation from the RMI client. 4) Skeleton:- A skeleton is the proxy of RMI client that hides the internal details of RMI from the remote object. In order to invoke remote method using RMI following sequence of operation are required.

Directory Server NameStub 1.2 Remote Object 1.1 Skeleton 1.0 RMI Client Stub Proxy for server Proxy for client JVM

1.0 Remote object is created 1.1 Stub & skeleton for the remote object is created. 1.2 Remote stub is registered with a logical name in directory server 2.0 search remote stub. 2.1 Remote stub is obtained 2.2 invokes remote method 2.3 establises connection with its skeleton & marshals method call to the skeleton 2.4 unmarshalls method call and invokes method on actual object

2.5 method completes and result is returned to skeleton 2.6 skeleton marshals result of method call to the stub. 2.7 stub unmarshals result and provide it to client. STEPS TO CREATE RMI BASED APPLICATION:- 1) Define a remote interface, each remote object exposes remote interface to its clients.this interface extends java.rmi.remote interface and provides remote method. Each remote method in the remote interface through java java.rmi.RemoteException.

2) Define a class that implements remote interface & provides Exporting logic.java.rmi.server.UnicastRemoteObject class provides exporting logic logic(Statements to create stub & skeleton for a remote object ) This class must be extended by the implementation class. 3) compile implementation class & generate its stub & skeleton class. rmic:(rmi compiler ) tools provided with jdk is used to generate stub & skeleton class for a rmi object. Syntax: rmic className of RemoteObject Ex. Rmic Myadder MyAdder_Stub.class & MyAdder_skeleton.class

4) start a directory service to facilitate registration & lookup of remote stub. An implementation of directory service is provided with jdk that provides the facility of registration & lookup of remote stub. syntax to start rmiregistry: 1) on default port(1099) Rmiregistry 2) on a specific port :- rmiregistry port number 5) Create remote object and register its stub with the directory server. Enter

Java.rmi.Naming : class provides static method to register or lookup a remote object with RMI registry. bind():- register a remote stub with the given name in the RMI registry. Public static void bind(String name, Remote Object)throws RemoteException, AlreadyBindException. rebind(): public static void rebind(String name,remote object)throws RemoteException ; Lookup():- is used for search remote stub. Public static Remote lookup(String lookup String)throws RemoteException; Formate of lookup String:- protocal/host Address/port/registered name Note: protocal/host address is optional if rmiregistry is running on default port on localhost.

5) Define a class to represent client: in client class obtain the reference of remote stub from the directory server and invoke remote method on it. If rmi registry is running on a different port then default method of registering remote stub is changed.i.e at the time of registration address of the host as well as port number of the rmi registry is used. For this purpose registry & LocateRegistryClass provided in java.rmi.registry package.

LocateRegistry class is a factory that provides method to obtain registry object. A registry object is used to bound,unbound or lookup a stub in the rmi registry. You can see easily using >javap java.rmi.registry.LocateRegistry >a.txt. > a.txt getRegistry() method of LocateRegistry class is used to create a registry object. 1)Public static registry getRegistry(String hostName) remote exception. 2) Public static Registry getRegistry(int port)throws remote exception.

Public static registry getRegistry(String host name,int port)throws remote exception; A registry class provides bind & rebind method to register an object to the directory server.