SlideShare a Scribd company logo
1 of 11
R E M O T E M E T H O D I N V O C A T I O N
1
JAVA
Content
2
 What is RMI?
 Stub
 Skeleton
 Architecture of RMI
 Working of an RMI Application
What is RMI?
3
 RMI stands for Remote Method Invocation.
 The RMI is an API that provides a mechanism to create distributed
application in java.
 The RMI provides remote communication between the applications
using two objects stub and skeleton.
Understanding stub and skeleton
4
 RMI uses stub and skeleton object for communication with the
remote object.
 A remote object is an object whose method can be invoked
from another JVM.
Stub
5
 The stub is an object, acts as a gateway for the client side.
 It resides at the client side and represents the remote object.
 When the caller invokes method on the stub object, it does the
following tasks:
• It initiates a connection with remote Virtual Machine (JVM),
• It writes and transmits (marshals) the parameters to the remote
Virtual Machine (JVM),
• It waits for the result
• It reads (unmarshals) the return value or exception, and
• It finally, returns the value to the caller.
Skeleton
6
 The skeleton is an object, acts as a gateway for the server side object.
 All the incoming requests are routed through it.
 When the skeleton receives the incoming request, it does the following
tasks:
• It reads the parameter for the remote method
• It invokes the method on the actual remote object, and
• It writes and transmits (marshals) the result to the caller.
Architecture of RMI Application
7
 In an RMI application, we write two programs, a server program
(resides on the server) and a client program (resides on the client).
 Inside the server program, a remote object is created and reference of
that object is made available for the client (using the registry).
 The client program requests the remote objects on the server and tries
to invoke its methods.
Architecture of RMI Application
8
Architecture of RMI Application
9
 Transport Layer − This layer connects the client and the server. It
manages the existing connection and also sets up new connections.
 Stub − A stub is a representation (proxy) of the remote object at
client. It resides in the client system; it acts as a gateway for the
client program.
 Skeleton − This is the object which resides on the server side. stub
communicates with this skeleton to pass request to the remote
object.
 RRL(Remote Reference Layer) − It is the layer which manages
the references made by the client to the remote object.
Working of an RMI Application
10
 When the client makes a call to the remote object, it is received by
the stub which eventually passes this request to the RRL.
 When the client-side RRL receives the request, it invokes a method
called invoke() of the object remoteRef. It passes the request to
the RRL on the server side.
 The RRL on the server side passes the request to the Skeleton (proxy
on the server) which finally invokes the required object on the server.
 The result is passed all the way back to the client.
11 Nilesh Va
Thank u….

More Related Content

What's hot (20)

JVM
JVMJVM
JVM
 
Java RMI
Java RMIJava RMI
Java RMI
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and Drivers
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 
5. IO virtualization
5. IO virtualization5. IO virtualization
5. IO virtualization
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
Java Streams
Java StreamsJava Streams
Java Streams
 
Ppt of socket
Ppt of socketPpt of socket
Ppt of socket
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Interface
InterfaceInterface
Interface
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
 
CORBA & RMI in java
CORBA & RMI in javaCORBA & RMI in java
CORBA & RMI in java
 

Similar to Java RMI(Remote Method Invocation)

Similar to Java RMI(Remote Method Invocation) (20)

Java rmi
Java rmiJava rmi
Java rmi
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
 
#4 (Remote Method Invocation)
#4 (Remote Method Invocation)#4 (Remote Method Invocation)
#4 (Remote Method Invocation)
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
Java rmi
Java rmiJava rmi
Java rmi
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorial
 
Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
Rmi
RmiRmi
Rmi
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Report on mini project(Student database handling using RMI)
Report on mini project(Student database handling using RMI)Report on mini project(Student database handling using RMI)
Report on mini project(Student database handling using RMI)
 
Oracle docs rmi applications
Oracle docs rmi applicationsOracle docs rmi applications
Oracle docs rmi applications
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
EJB.docx
EJB.docxEJB.docx
EJB.docx
 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

Java RMI(Remote Method Invocation)

  • 1. R E M O T E M E T H O D I N V O C A T I O N 1 JAVA
  • 2. Content 2  What is RMI?  Stub  Skeleton  Architecture of RMI  Working of an RMI Application
  • 3. What is RMI? 3  RMI stands for Remote Method Invocation.  The RMI is an API that provides a mechanism to create distributed application in java.  The RMI provides remote communication between the applications using two objects stub and skeleton.
  • 4. Understanding stub and skeleton 4  RMI uses stub and skeleton object for communication with the remote object.  A remote object is an object whose method can be invoked from another JVM.
  • 5. Stub 5  The stub is an object, acts as a gateway for the client side.  It resides at the client side and represents the remote object.  When the caller invokes method on the stub object, it does the following tasks: • It initiates a connection with remote Virtual Machine (JVM), • It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM), • It waits for the result • It reads (unmarshals) the return value or exception, and • It finally, returns the value to the caller.
  • 6. Skeleton 6  The skeleton is an object, acts as a gateway for the server side object.  All the incoming requests are routed through it.  When the skeleton receives the incoming request, it does the following tasks: • It reads the parameter for the remote method • It invokes the method on the actual remote object, and • It writes and transmits (marshals) the result to the caller.
  • 7. Architecture of RMI Application 7  In an RMI application, we write two programs, a server program (resides on the server) and a client program (resides on the client).  Inside the server program, a remote object is created and reference of that object is made available for the client (using the registry).  The client program requests the remote objects on the server and tries to invoke its methods.
  • 8. Architecture of RMI Application 8
  • 9. Architecture of RMI Application 9  Transport Layer − This layer connects the client and the server. It manages the existing connection and also sets up new connections.  Stub − A stub is a representation (proxy) of the remote object at client. It resides in the client system; it acts as a gateway for the client program.  Skeleton − This is the object which resides on the server side. stub communicates with this skeleton to pass request to the remote object.  RRL(Remote Reference Layer) − It is the layer which manages the references made by the client to the remote object.
  • 10. Working of an RMI Application 10  When the client makes a call to the remote object, it is received by the stub which eventually passes this request to the RRL.  When the client-side RRL receives the request, it invokes a method called invoke() of the object remoteRef. It passes the request to the RRL on the server side.  The RRL on the server side passes the request to the Skeleton (proxy on the server) which finally invokes the required object on the server.  The result is passed all the way back to the client.