SlideShare una empresa de Scribd logo
1 de 22
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

Más contenido relacionado

La actualidad más candente

Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Nilesh Valva
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMIbackdoor
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Sonali Parab
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVAJalpesh Vasa
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVAPrankit Mishra
 
Java RMI Detailed Tutorial
Java RMI Detailed TutorialJava RMI Detailed Tutorial
Java RMI Detailed TutorialMasud Rahman
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI PresentationMasud Rahman
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Peter R. Egli
 
Java remote method invocation
Java remote method invocationJava remote method invocation
Java remote method invocationVan Dawn
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationSabiha M
 

La actualidad más candente (20)

Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
Java rmi
Java rmiJava rmi
Java rmi
 
Rmi
RmiRmi
Rmi
 
Rmi
RmiRmi
Rmi
 
Java RMI Detailed Tutorial
Java RMI Detailed TutorialJava RMI Detailed Tutorial
Java RMI Detailed Tutorial
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
Java RMI
Java RMIJava RMI
Java RMI
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To Rmi
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
Java remote method invocation
Java remote method invocationJava remote method invocation
Java remote method invocation
 
Rmi architecture
Rmi architectureRmi architecture
Rmi architecture
 
Java RMI
Java RMIJava RMI
Java RMI
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorial
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 

Destacado

Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocationRiccardo Cardin
 
Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)eLink Business Innovations
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with codekamal kotecha
 
Remote invocation
Remote invocationRemote invocation
Remote invocationishapadhy
 
Remote method invocation (as part of the the PTT lecture)
Remote method invocation (as part of the the PTT lecture)Remote method invocation (as part of the the PTT lecture)
Remote method invocation (as part of the the PTT lecture)Ralf Laemmel
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocationelliando dias
 
Inter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationInter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationMayur Shah
 
Introduction to C++ Remote Procedure Call (RPC)
Introduction to C++ Remote Procedure Call (RPC)Introduction to C++ Remote Procedure Call (RPC)
Introduction to C++ Remote Procedure Call (RPC)Abdelrahman Al-Ogail
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Overview of big data in cloud computing
Overview of big data in cloud computingOverview of big data in cloud computing
Overview of big data in cloud computingViet-Trung TRAN
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communicationAbDul ThaYyal
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure callsAshish Kumar
 
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...Varun Patel
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 

Destacado (18)

Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 
Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
Remote invocation
Remote invocationRemote invocation
Remote invocation
 
Remote method invocation (as part of the the PTT lecture)
Remote method invocation (as part of the the PTT lecture)Remote method invocation (as part of the the PTT lecture)
Remote method invocation (as part of the the PTT lecture)
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
IPC SOCKET
IPC SOCKETIPC SOCKET
IPC SOCKET
 
Inter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationInter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communication
 
Introduction to C++ Remote Procedure Call (RPC)
Introduction to C++ Remote Procedure Call (RPC)Introduction to C++ Remote Procedure Call (RPC)
Introduction to C++ Remote Procedure Call (RPC)
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Overview of big data in cloud computing
Overview of big data in cloud computingOverview of big data in cloud computing
Overview of big data in cloud computing
 
Socket System Calls
Socket System CallsSocket System Calls
Socket System Calls
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communication
 
Network Sockets
Network SocketsNetwork Sockets
Network Sockets
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
Piping Training course-How to be an Expert in Pipe & Fittings for Oil & Gas c...
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 

Similar a Remote method invocation

Similar a Remote method invocation (20)

Oracle docs rmi applications
Oracle docs rmi applicationsOracle docs rmi applications
Oracle docs rmi applications
 
Rmi
RmiRmi
Rmi
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
Basic java
Basic java Basic java
Basic java
 
Rmi
RmiRmi
Rmi
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
 
Java interview questions for freshers
Java interview questions for freshersJava interview questions for freshers
Java interview questions for freshers
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
Rmi3
Rmi3Rmi3
Rmi3
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
#4 (Remote Method Invocation)
#4 (Remote Method Invocation)#4 (Remote Method Invocation)
#4 (Remote Method Invocation)
 
DS
DSDS
DS
 

Último

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

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

Notas del editor

  1. Slide dekhebolleihobe