SlideShare a Scribd company logo
RMI
Concurrent & Distributed software

BY
Ravi Theja Y
Remote Procedure Calls (RPC)
•Goal: To provide a procedural interface for distributed (i.e., remote)

services

•To make distributed nature of service transparent to the programmer

Remote Method Invocation (RMI)
•Goal: RPC + Object Orientation
•Allows objects living in one process to invoke methods of an object living

in another process
Middleware layers

Middleware layers
Request and Reply communication
Conventional Procedure Call
Parameter passing in a local procedure call: the stack before the call to
read(fd,buf,bytes)
The stack while the called procedure is active
Remote Procedure Call
Principle of RPC between a client and server program.
Remote Procedure Calls
Remote procedure call (RPC) abstracts procedure calls between processes on networked
systems.
Stubs – client-side proxy for the actual procedure on the server.
The client-side stub locates the server and marshalls the parameters.
The server-side stub receives this message, unpacks the marshalled parameters, and
performs the procedure on the server.
Steps of a Remote Procedure Call
1.

Client procedure calls client stub in normal way

2.

Client stub builds message, calls local OS

3.

Client's OS sends message to remote OS

4.

Remote OS gives message to server stub

5.

Server stub unpacks parameters, calls server

6.

Server does work, returns result to the stub

7.

Server stub packs it in message, calls local OS

8.

Server's OS sends message to client's OS

9.

Client's OS gives message to client stub

10. Stub unpacks result, returns to client
RMI
RMI = RPC + Object-orientation
Java RMI
CORBA
• Middleware that is language-independent

Microsoft DCOM/COM+
SOAP
• RMI on top of HTTP
Interfaces in distributed systems
Programs organized as a set of modules that communicate with one another via
procedure calls/method invocations
Explicit interfaces defined for each module in order to control interactions between
modules
In distributed systems, modules can be in different processes
A remote interface specifies the methods of an object that are available for invocation
by objects in other processes defining the types of the input and output arguments of
each of them.
Object model
Object references
Objects accessed via object references
Object references can be assigned to variables, passed as arguments and returned as
results
Interfaces provides a signature of a set of methods (types of arguments, return values
and exceptions) without specifying their implementations
Actions (invocations)
Exceptions
Garbage Collection
Distributed Objects
Remote object references
An identifier that can be used throughout a distributed
system to refer to a particular remote object
Remote interfaces
CORBA provides an interface definition language (IDL) for specifying a remote interface
JAVA RMI: Java interface that extends Remote interface
Actions: remote invocations
Remote Exceptions may arise for reasons such as partial failure or message loss
Distributed Garbage Collection: cooperation between local garbage collectors needed
Remote and local method
invocations

A remote object and its remote
interface
RMI Programming
RMI software
Generated by IDL compiler
Proxy
• Behaves like remote object to clients (invoker)
• Marshals arguments, forwards message to remote object, unmarshals
results, returns results to client

Skeleton
• Server side stub;
• Unmarshals arguments, invokes method, marshals results and sends
to sending proxy’s method

Dispatcher
• Receives the request message from communication module, passes
on the message to the appropriate method in the skeleton
Role of proxy and skeleton in remote method
invocation
Calculator.java
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Calculator extends Remote
{
public long add(long a,long b) throws RemoteException;
}

Calculatorserver.java

Calculatorimpl.java

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class CalculatorImpl extends UnicastRemoteObject implements Calculator
{
protected CalculatorImpl() throws RemoteException
{
super();
}
public long add(long a, long b) throws RemoteException
{
return a+b;
}
}
-------------------------------------------------------------------------------------------

import java.rmi.Naming;
public class CalculatorServer
{
CalculatorServer()
{try
{
Calculator c = new CalculatorImpl();
Naming.rebind("rmi://127.0.0.1:1099/CalculatorService", c);
}
catch (Exception e)
{ e.printStackTrace(); }
}
public static void main(String[] args)
{
new CalculatorServer();
}}

import java.rmi.Naming;
public class CalculatorClient
{
public static void main(String[] args)
Calculatorclient.java
{
try
{
Calculator c = (Calculator)
Naming.lookup("//127.0.0.1:1099/CalculatorService");
System.out.println("addition : "+c.add(10, 15));
}
catch (Exception e)
{
System.out.println(e);
}}}
RMI systems
CORBA – language independent
DCOM - Microsoft
Java RMI
SOAP (Simple Object Access Protocol)
HTTP is request-reply protocol
XML for data representation
Thank you

More Related Content

What's hot

ASP.NET Basics
ASP.NET Basics ASP.NET Basics
Introduction
IntroductionIntroduction
Introduction
Hiren Selani
 
Domain name system presentation
Domain name system presentationDomain name system presentation
Domain name system presentation
Anchit Dhingra
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 
Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
Satyamevjayte Haxor
 
Unit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingUnit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scripting
sana mateen
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
 
Java API: java.net.InetAddress
Java API: java.net.InetAddressJava API: java.net.InetAddress
Java API: java.net.InetAddress
Sayak Sarkar
 
Code optimization
Code optimizationCode optimization
Code optimization
veena venugopal
 
Java Networking
Java NetworkingJava Networking
Java Networking
Sunil OS
 
Java
JavaJava
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
Elizabeth Thomas
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
Adeel Rasheed
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
Java Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web ApplicationJava Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web Application
IMC Institute
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilation
Huawei Technologies
 
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
Meghaj Mallick
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
Jainul Musani
 

What's hot (20)

ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
Introduction
IntroductionIntroduction
Introduction
 
Domain name system presentation
Domain name system presentationDomain name system presentation
Domain name system presentation
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
 
Unit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingUnit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scripting
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Java API: java.net.InetAddress
Java API: java.net.InetAddressJava API: java.net.InetAddress
Java API: java.net.InetAddress
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Java
JavaJava
Java
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Java Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web ApplicationJava Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web Application
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilation
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
 

Viewers also liked

Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
Peter R. Egli
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
Paul Pajo
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
Azul Systems Inc.
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
Abdelrahman Al-Ogail
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
Masud Rahman
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
Ashish Kumar
 

Viewers also liked (6)

Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 

Similar to remote method invocation

RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
Thesis Scientist Private Limited
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and models
Mayank Jain
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
ashishspace
 
009693652.pdf
009693652.pdf009693652.pdf
009693652.pdf
KhadijaTahir29
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Rmi
RmiRmi
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
Prajakta Rane
 
DS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfDS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdf
VarshaBaini
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
Kathirvel Ayyaswamy
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
Kathirvel Ayyaswamy
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
Ankit Dubey
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
DS
DSDS
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
FamiDan
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
Kathirvel Ayyaswamy
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
Kathirvel Ayyaswamy
 
Rmi
RmiRmi
Rmi
RmiRmi

Similar to remote method invocation (20)

RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and models
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
009693652.pdf
009693652.pdf009693652.pdf
009693652.pdf
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
 
Rmi
RmiRmi
Rmi
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
 
DS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfDS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdf
 
20CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 220CS2021-Distributed Computing module 2
20CS2021-Distributed Computing module 2
 
20CS2021 Distributed Computing
20CS2021 Distributed Computing 20CS2021 Distributed Computing
20CS2021 Distributed Computing
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
DS
DSDS
DS
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
18CS3040_Distributed Systems
18CS3040_Distributed Systems18CS3040_Distributed Systems
18CS3040_Distributed Systems
 
18CS3040 Distributed System
18CS3040 Distributed System	18CS3040 Distributed System
18CS3040 Distributed System
 
Rmi
RmiRmi
Rmi
 
Rmi
RmiRmi
Rmi
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

remote method invocation

  • 1. RMI Concurrent & Distributed software BY Ravi Theja Y
  • 2. Remote Procedure Calls (RPC) •Goal: To provide a procedural interface for distributed (i.e., remote) services •To make distributed nature of service transparent to the programmer Remote Method Invocation (RMI) •Goal: RPC + Object Orientation •Allows objects living in one process to invoke methods of an object living in another process
  • 4. Request and Reply communication
  • 5. Conventional Procedure Call Parameter passing in a local procedure call: the stack before the call to read(fd,buf,bytes) The stack while the called procedure is active
  • 6. Remote Procedure Call Principle of RPC between a client and server program.
  • 7. Remote Procedure Calls Remote procedure call (RPC) abstracts procedure calls between processes on networked systems. Stubs – client-side proxy for the actual procedure on the server. The client-side stub locates the server and marshalls the parameters. The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server.
  • 8. Steps of a Remote Procedure Call 1. Client procedure calls client stub in normal way 2. Client stub builds message, calls local OS 3. Client's OS sends message to remote OS 4. Remote OS gives message to server stub 5. Server stub unpacks parameters, calls server 6. Server does work, returns result to the stub 7. Server stub packs it in message, calls local OS 8. Server's OS sends message to client's OS 9. Client's OS gives message to client stub 10. Stub unpacks result, returns to client
  • 9. RMI RMI = RPC + Object-orientation Java RMI CORBA • Middleware that is language-independent Microsoft DCOM/COM+ SOAP • RMI on top of HTTP
  • 10. Interfaces in distributed systems Programs organized as a set of modules that communicate with one another via procedure calls/method invocations Explicit interfaces defined for each module in order to control interactions between modules In distributed systems, modules can be in different processes A remote interface specifies the methods of an object that are available for invocation by objects in other processes defining the types of the input and output arguments of each of them.
  • 11. Object model Object references Objects accessed via object references Object references can be assigned to variables, passed as arguments and returned as results Interfaces provides a signature of a set of methods (types of arguments, return values and exceptions) without specifying their implementations Actions (invocations) Exceptions Garbage Collection Distributed Objects Remote object references An identifier that can be used throughout a distributed system to refer to a particular remote object Remote interfaces CORBA provides an interface definition language (IDL) for specifying a remote interface JAVA RMI: Java interface that extends Remote interface Actions: remote invocations Remote Exceptions may arise for reasons such as partial failure or message loss Distributed Garbage Collection: cooperation between local garbage collectors needed
  • 12. Remote and local method invocations A remote object and its remote interface
  • 13. RMI Programming RMI software Generated by IDL compiler Proxy • Behaves like remote object to clients (invoker) • Marshals arguments, forwards message to remote object, unmarshals results, returns results to client Skeleton • Server side stub; • Unmarshals arguments, invokes method, marshals results and sends to sending proxy’s method Dispatcher • Receives the request message from communication module, passes on the message to the appropriate method in the skeleton
  • 14. Role of proxy and skeleton in remote method invocation
  • 15. Calculator.java import java.rmi.Remote; import java.rmi.RemoteException; public interface Calculator extends Remote { public long add(long a,long b) throws RemoteException; } Calculatorserver.java Calculatorimpl.java import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class CalculatorImpl extends UnicastRemoteObject implements Calculator { protected CalculatorImpl() throws RemoteException { super(); } public long add(long a, long b) throws RemoteException { return a+b; } } ------------------------------------------------------------------------------------------- import java.rmi.Naming; public class CalculatorServer { CalculatorServer() {try { Calculator c = new CalculatorImpl(); Naming.rebind("rmi://127.0.0.1:1099/CalculatorService", c); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { new CalculatorServer(); }} import java.rmi.Naming; public class CalculatorClient { public static void main(String[] args) Calculatorclient.java { try { Calculator c = (Calculator) Naming.lookup("//127.0.0.1:1099/CalculatorService"); System.out.println("addition : "+c.add(10, 15)); } catch (Exception e) { System.out.println(e); }}}
  • 16. RMI systems CORBA – language independent DCOM - Microsoft Java RMI SOAP (Simple Object Access Protocol) HTTP is request-reply protocol XML for data representation