SlideShare a Scribd company logo
GROUP MEMBERS
MD. SHAHRIAR ANWAR (09.02.04.088)
NASHIYED ARAFUL HAQUE (09.02.04.078)
Remote Method Invocation
(RMI)
Overview
 Introduction of RMI
 Uses of RMI
 Interfaces and Classes
 RMI Architecture
 RMI Application Overview
 Remote Object and Interface Explained
 A short demonstration of RMI application
What is RMI?
 Remote Method Invocation (RMI), allows one host
to run programs on another host that is running a
program on a remote host from a local machine.
In Brief:
 It’s a core JAVA API
 Enables programs calling methods in objects
running on different host even though both
program exists in two physically different hosts.
Why We Need RMI?
Let’s think a scenario -
 Suppose you’re an owner of a large company. You’re
company have branches all over the country.
 Now if one of your company branch need to get
services/data from head office, how they’ll do it?
Answer is : RMI
We’ll show you how that work and what it does
Interface and Classes in Package java.rmi
RemoteObject
RemoteServer
Activatable UnicastRemoteobject
Remote
Interface Classes
RMI Architecture
 The server must first bind its name to
the registry
 The client lookup the server name in
the registry to establish remote
references.
 The Stub serializing the parameters to
skeleton, the skeleton invoking the
remote method and serializing the
result back to the stub.
The Stubs and Skeleton
RMI Client Stubs Skeleton RMI Server
Call
Return
 A client invokes a remote method, the call is first forwarded to stub.
 The stub is responsible for sending the remote call over to the
serverside skeleton
 The stub opening a socket to the remote server, marshaling the object
parameters and forwarding the data stream to the skeleton.
 A skeleton contains a method that receives the remote calls, unmarshals
the parameters, and invokes the actual remote object implementation.
RMI Application Overview
 RMI applications consist of two separate programs, a
server and a client.
 Server program creates some remote objects, makes
references to these objects accessible, and waits for
clients to invoke methods on these objects.
 Client program obtains a remote reference to one or
more remote objects on a server and then invokes
methods on them.
Remote Object
 An object with methods that may be invoked from
a different Java virtual machine than the one
running on a different computer.
 Each remote object implements one or more
remote interfaces that declare which methods of
the remote object can be invoked by the foreign
system.
Remote interfaces, Objects and Methods
Remote Object
 Objects with methods that can be invoked across
Java virtual machines are called remote objects
 Remote Object implements Remote Interface
 A Remote Interface extends java.rmi.Remote
interface
 Each method of the interface declares
java.rmi.RemoteException in its throws clause
Remote Interface Explained
 Let’s take a sample code snippet
import java.rmi.*;
public interface HomeWork extends Remote {
public String giveMeYourHomeWork( ) throws RemoteException;
}
Remote Interface Explained (cont…)
 Java program running on your workstation (e.g. JVM on
you.com) could look up the current HomeWork object in the
RMI registry at remote virtual machine (e.g. JVM on
yourfriend.com).
 The registry would send it a reference to the object running in
remote (yourfriend.com 's) virtual machine.
 Your program could then use this reference to invoke the
giveMeYourHomeWork( ) method.
 The giveMeYourHomeWork( ) method would execute on the
server in remote machine not on your local machine.
However, it would return the String value back to your local
program running in your local machine.
A Short RMI Example
 What this program does?
 This is a simple program which pass two integers to Server
through RMI and invoke remote method from Client to
calculate their Sum.
 There are 3 classes and 1 interface
 SumInterface
 SumImpl
 RMIServer
 RMIClient
SumInterface.java
SumImpl.java
RMIServer.java
RMIClient.java
Compiling and Running from Terminal
Compiling …
After compiling following classes are generated …
Generating Stubs and Starting RMI Registry
Generating Stubs and Starting RMI Registry …
After generating Stubs directory looks like …
Starting Server and Client
Open a new Terminal and start the server …
Open another new Terminal and start the Client … (You’ll get result immediately)
References
 http://www.javacoffeebreak.com/articles/javarmi/ja
varmi.html
 http://docs.oracle.com/javase/7/docs/platform/rmi
/spec/rmi-arch2.html
 http://en.wikipedia.org/wiki/Java_remote_method
_invocation
 http://docs.oracle.com/javase/7/docs/api/java/rmi/
package-summary.html
Remote method invocation

More Related Content

PPT
Rmi
leminhvuong
 
PPT
Remote Method Invocation
Paul Pajo
 
PDF
Remote Method Invocation
ashishspace
 
PPT
A Short Java RMI Tutorial
Guo Albert
 
PPT
RMI
Aravind Nair
 
PPSX
Java rmi
Tanmoy Barman
 
PDF
Java rmi
Fazlur Rahman
 
PDF
Rmi ppt-2003
kalaranjani1990
 
Remote Method Invocation
Paul Pajo
 
Remote Method Invocation
ashishspace
 
A Short Java RMI Tutorial
Guo Albert
 
Java rmi
Tanmoy Barman
 
Java rmi
Fazlur Rahman
 
Rmi ppt-2003
kalaranjani1990
 

What's hot (20)

PPTX
Java RMI(Remote Method Invocation)
Nilesh Valva
 
PPT
Distributed Programming using RMI
backdoor
 
PPTX
Remote Method Invocation (Java RMI)
Sonali Parab
 
PDF
Remote Method Invocation in JAVA
Jalpesh Vasa
 
PPTX
Remote Method Innovation (RMI) In JAVA
Prankit Mishra
 
PPS
Java rmi
kamal kotecha
 
PPTX
Rmi
Jafar Nesargi
 
PPTX
Rmi
Vijay Kiran
 
PDF
Java RMI Detailed Tutorial
Masud Rahman
 
PPTX
Java RMI
Ankit Desai
 
PPTX
Rmi presentation
Azad public school
 
PPTX
Introduction To Rmi
SwarupKulkarni
 
PPTX
Java RMI Presentation
Masud Rahman
 
PDF
Remote Method Invocation (RMI)
Peter R. Egli
 
PPT
Java remote method invocation
Van Dawn
 
PPTX
Rmi architecture
Maulik Desai
 
PPTX
Java RMI
Prajakta Nimje
 
PDF
Java rmi tutorial
HarikaReddy115
 
PPTX
Remote Method Invocation
Sabiha M
 
Java RMI(Remote Method Invocation)
Nilesh Valva
 
Distributed Programming using RMI
backdoor
 
Remote Method Invocation (Java RMI)
Sonali Parab
 
Remote Method Invocation in JAVA
Jalpesh Vasa
 
Remote Method Innovation (RMI) In JAVA
Prankit Mishra
 
Java rmi
kamal kotecha
 
Java RMI Detailed Tutorial
Masud Rahman
 
Java RMI
Ankit Desai
 
Rmi presentation
Azad public school
 
Introduction To Rmi
SwarupKulkarni
 
Java RMI Presentation
Masud Rahman
 
Remote Method Invocation (RMI)
Peter R. Egli
 
Java remote method invocation
Van Dawn
 
Rmi architecture
Maulik Desai
 
Java RMI
Prajakta Nimje
 
Java rmi tutorial
HarikaReddy115
 
Remote Method Invocation
Sabiha M
 
Ad

Viewers also liked (18)

PPTX
Java - Remote method invocation
Riccardo Cardin
 
PDF
Introduction to Remote Method Invocation (RMI)
eLink Business Innovations
 
PPS
Java rmi example program with code
kamal kotecha
 
PPT
Remote invocation
ishapadhy
 
PDF
Remote method invocation (as part of the the PTT lecture)
Ralf Laemmel
 
PDF
Remote Method Invocation
elliando dias
 
PPTX
IPC SOCKET
Sanoj Kumar
 
PPTX
Inter-Process communication using pipe in FPGA based adaptive communication
Mayur Shah
 
PPTX
Introduction to C++ Remote Procedure Call (RPC)
Abdelrahman Al-Ogail
 
PDF
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
PPTX
RPC: Remote procedure call
Sunita Sahu
 
PDF
Overview of big data in cloud computing
Viet-Trung TRAN
 
PPT
Socket System Calls
Avinash Varma Kalidindi
 
PPT
Chapter 4 a interprocess communication
AbDul ThaYyal
 
PDF
Network Sockets
Peter R. Egli
 
PPT
remote procedure calls
Ashish Kumar
 
PDF
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Varun Patel
 
PDF
Designing Teams for Emerging Challenges
Aaron Irizarry
 
Java - Remote method invocation
Riccardo Cardin
 
Introduction to Remote Method Invocation (RMI)
eLink Business Innovations
 
Java rmi example program with code
kamal kotecha
 
Remote invocation
ishapadhy
 
Remote method invocation (as part of the the PTT lecture)
Ralf Laemmel
 
Remote Method Invocation
elliando dias
 
IPC SOCKET
Sanoj Kumar
 
Inter-Process communication using pipe in FPGA based adaptive communication
Mayur Shah
 
Introduction to C++ Remote Procedure Call (RPC)
Abdelrahman Al-Ogail
 
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
RPC: Remote procedure call
Sunita Sahu
 
Overview of big data in cloud computing
Viet-Trung TRAN
 
Socket System Calls
Avinash Varma Kalidindi
 
Chapter 4 a interprocess communication
AbDul ThaYyal
 
Network Sockets
Peter R. Egli
 
remote procedure calls
Ashish Kumar
 
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Varun Patel
 
Designing Teams for Emerging Challenges
Aaron Irizarry
 
Ad

Similar to Remote method invocation (20)

DOCX
Oracle docs rmi applications
Biswabrata Banerjee
 
PPT
Rmi
phanleson
 
DOCX
Remote Method Invocation
Sonali Parab
 
PDF
RMI (Remote Method Invocation)
Thesis Scientist Private Limited
 
PPTX
Basic java
Raghu nath
 
PDF
Rmi
vantinhkhuc
 
PPT
Remote method invocation
MNM Jain Engineering College
 
PPTX
Remote method invocatiom
sakthibalabalamuruga
 
PDF
Distributed objects
Sharafat Husen
 
PPTX
Remote method invocation
Veni7
 
PDF
Module 3 remote method invocation-2
Ankit Dubey
 
DOCX
Java interview questions for freshers
SkillPracticalEdTech
 
PPSX
Javarmi 130925082348-phpapp01
heenamithadiya
 
DOCX
ADB Lab Manual.docx
SaiKumarPrajapathi
 
DOCX
remote method invocation
Arun Nair
 
PPT
Distributed Programming using RMI
backdoor
 
PPTX
RMI_0745444444444444444444444111119.pptx
nailapp2023
 
PDF
Remote Method Invocation, Advanced programming
Gera Paulos
 
PPTX
#4 (Remote Method Invocation)
Ghadeer AlHasan
 
Oracle docs rmi applications
Biswabrata Banerjee
 
Remote Method Invocation
Sonali Parab
 
RMI (Remote Method Invocation)
Thesis Scientist Private Limited
 
Basic java
Raghu nath
 
Remote method invocation
MNM Jain Engineering College
 
Remote method invocatiom
sakthibalabalamuruga
 
Distributed objects
Sharafat Husen
 
Remote method invocation
Veni7
 
Module 3 remote method invocation-2
Ankit Dubey
 
Java interview questions for freshers
SkillPracticalEdTech
 
Javarmi 130925082348-phpapp01
heenamithadiya
 
ADB Lab Manual.docx
SaiKumarPrajapathi
 
remote method invocation
Arun Nair
 
Distributed Programming using RMI
backdoor
 
RMI_0745444444444444444444444111119.pptx
nailapp2023
 
Remote Method Invocation, Advanced programming
Gera Paulos
 
#4 (Remote Method Invocation)
Ghadeer AlHasan
 

Recently uploaded (20)

PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Doc9.....................................
SofiaCollazos
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 

Remote method invocation

  • 1. GROUP MEMBERS MD. SHAHRIAR ANWAR (09.02.04.088) NASHIYED ARAFUL HAQUE (09.02.04.078) Remote Method Invocation (RMI)
  • 2. Overview  Introduction of RMI  Uses of RMI  Interfaces and Classes  RMI Architecture  RMI Application Overview  Remote Object and Interface Explained  A short demonstration of RMI application
  • 3. What is RMI?  Remote Method Invocation (RMI), allows one host to run programs on another host that is running a program on a remote host from a local machine. In Brief:  It’s a core JAVA API  Enables programs calling methods in objects running on different host even though both program exists in two physically different hosts.
  • 4. Why We Need RMI? Let’s think a scenario -  Suppose you’re an owner of a large company. You’re company have branches all over the country.  Now if one of your company branch need to get services/data from head office, how they’ll do it? Answer is : RMI We’ll show you how that work and what it does
  • 5. Interface and Classes in Package java.rmi RemoteObject RemoteServer Activatable UnicastRemoteobject Remote Interface Classes
  • 6. RMI Architecture  The server must first bind its name to the registry  The client lookup the server name in the registry to establish remote references.  The Stub serializing the parameters to skeleton, the skeleton invoking the remote method and serializing the result back to the stub.
  • 7. The Stubs and Skeleton RMI Client Stubs Skeleton RMI Server Call Return  A client invokes a remote method, the call is first forwarded to stub.  The stub is responsible for sending the remote call over to the serverside skeleton  The stub opening a socket to the remote server, marshaling the object parameters and forwarding the data stream to the skeleton.  A skeleton contains a method that receives the remote calls, unmarshals the parameters, and invokes the actual remote object implementation.
  • 8. RMI Application Overview  RMI applications consist of two separate programs, a server and a client.  Server program creates some remote objects, makes references to these objects accessible, and waits for clients to invoke methods on these objects.  Client program obtains a remote reference to one or more remote objects on a server and then invokes methods on them.
  • 9. Remote Object  An object with methods that may be invoked from a different Java virtual machine than the one running on a different computer.  Each remote object implements one or more remote interfaces that declare which methods of the remote object can be invoked by the foreign system.
  • 10. Remote interfaces, Objects and Methods Remote Object  Objects with methods that can be invoked across Java virtual machines are called remote objects  Remote Object implements Remote Interface  A Remote Interface extends java.rmi.Remote interface  Each method of the interface declares java.rmi.RemoteException in its throws clause
  • 11. Remote Interface Explained  Let’s take a sample code snippet import java.rmi.*; public interface HomeWork extends Remote { public String giveMeYourHomeWork( ) throws RemoteException; }
  • 12. Remote Interface Explained (cont…)  Java program running on your workstation (e.g. JVM on you.com) could look up the current HomeWork object in the RMI registry at remote virtual machine (e.g. JVM on yourfriend.com).  The registry would send it a reference to the object running in remote (yourfriend.com 's) virtual machine.  Your program could then use this reference to invoke the giveMeYourHomeWork( ) method.  The giveMeYourHomeWork( ) method would execute on the server in remote machine not on your local machine. However, it would return the String value back to your local program running in your local machine.
  • 13. A Short RMI Example  What this program does?  This is a simple program which pass two integers to Server through RMI and invoke remote method from Client to calculate their Sum.  There are 3 classes and 1 interface  SumInterface  SumImpl  RMIServer  RMIClient
  • 18. Compiling and Running from Terminal Compiling … After compiling following classes are generated …
  • 19. Generating Stubs and Starting RMI Registry Generating Stubs and Starting RMI Registry … After generating Stubs directory looks like …
  • 20. Starting Server and Client Open a new Terminal and start the server … Open another new Terminal and start the Client … (You’ll get result immediately)
  • 21. References  http://www.javacoffeebreak.com/articles/javarmi/ja varmi.html  http://docs.oracle.com/javase/7/docs/platform/rmi /spec/rmi-arch2.html  http://en.wikipedia.org/wiki/Java_remote_method _invocation  http://docs.oracle.com/javase/7/docs/api/java/rmi/ package-summary.html

Editor's Notes

  • #13: Slide dekhebolleihobe