SlideShare a Scribd company logo
1 of 23
RMI




      http://www.java2all.com
Chapter 1



RMI Introduction



                   http://www.java2all.com
RMI Introduction:



                    http://www.java2all.com
RMI stands for “Remote Method
Invocation” means communicating the object
across the network.
    RMI is a one type of structure or system
that allows an object running in one Java
virtual machine (Client) to invoke methods on
an object running in another Java virtual
machine (Server).This object is called a
Remote Object and such a system is also
called RMI Distributed Application.

                                    http://www.java2all.com
RMI provides for remote communication
between programs written in the JAVA.
General functioning diagram :




                                   http://www.java2all.com
The complete RMI system has a FOUR layer,

(1)   Application Layer
(2)   Proxy Layer
(3)   Remote Reference Layer
(4)   Transport Layer

Mainly the RMI application contains the THREE
components,
(1) RMI Server
(2) RMI Client
(3) RMI Registry

                                        http://www.java2all.com
RMI Architecture:




                    http://www.java2all.com
The RMI Architecture (System) has a FOUR
layer,

(1)   Application Layer
(2)   Proxy Layer
(3)   Remote Reference Layer
(4)   Transport Layer


RMI Architecture Diagram:



                                        http://www.java2all.com
http://www.java2all.com
(1) Application Layer:
      It’s a responsible for the actual logic
(implementation) of the client and server applications.
Generally at the server side class contain
implementation logic and also apply the reference to
the appropriate object as per the requirement of the
logic in application.
(2) Proxy Layer:
      It’s also called the “Stub/Skeleton layer”.
      A Stub class is a client side proxy handles the
remote objects which are getting from the reference.
A Skeleton class is a server side proxy that set the
reference to the objects which are communicates with
the Stub.                                     http://www.java2all.com
(3) Remote Reference Layer (RRL):
       It’s a responsible for manage the references
made by the client to the remote object on the server
so it is available on both JVM (Client and Server).
The Client side RRL receives the request for methods
from the Stub that is transferred into byte stream
process called serialization (Marshaling) and then
these data are send to the Server side RRL.

     The Server side RRL doing reverse process and
convert the binary data into object. This process called
deserialization or unmarshaling and then sent to the
Skeleton class.
                                              http://www.java2all.com
(4) Transport Layer:

       It’s also called the “Connection layer”.
It’s a responsible for the managing the existing
connection and also setting up new connections.
So it is a work like a link between the RRL on the
Client side and the RRL on the Server side.




                                            http://www.java2all.com
RMI Components:




                  http://www.java2all.com
The RMI application contains the THREE components

(1) RMI Server
(2) RMI Client
(3) RMI Registry




                                        http://www.java2all.com
http://www.java2all.com
(1) RMI Server:

       RMI Server contains objects whose methods are
to be called remotely. It creates remote objects and
applies the reference to these objects in the Registry,
after that the Registry registers these objects who are
going to be called by client remotely.

(2) RMI Client:

     The RMI Client gets the reference of one or
more remote objects from Registry with the help of
object name.
                                             http://www.java2all.com
Now, it can be invokes the methods on the
remote object to access the services of the objects as
per the requirement of logic in RMI application.

       Once the client gets the reference of remote
object, the methods in the remote object are invoked
just like as the methods of a local object.

(3) RMI Registry:

In the Server side the reference of the object (which is
invoked remotely) is applied and after that this
reference is set in the RMI registry.
                                              http://www.java2all.com
When the Client call the method on this object,
it’s not directly call but it call by the reference which
is already set in the Registry so first get the object
from this reference which is available at RMI Registry
then after calls the methods as per the requirement of
logic in RMI application.




                                              http://www.java2all.com
RMI Registry:




                http://www.java2all.com
The RMI Registry is a naming service.
RMI server programs use this service to bind the
remote java object with the names.

      Clients executing on local or remote machines
retrieve the remote objects by their name registered
with the RMI registry and then execute methods on
the objects.

      RMI creates a remote proxy for that object and
sent it to clients.
      An object proxy contains the reference to an
object. In order to work with the RMI registry...
                                             http://www.java2all.com
1. Start registry by using following command
           start rmiregistry

       By default the port 1099 is used by RMI registry
to look up the remote objects. After the RMI registry
starts objects can bind to it.

2. Now in second step to bind the remote object with
the RMI registry, execute the server program.

3. To use the remote object execute the client
program.

                                             http://www.java2all.com
http://www.java2all.com
From the figure we can see that server calls the
RMI registry to map a name with a remote object
represented by black circle.

     By using the name of remote objects in the
server's registry client program locate the remote
object and then methods are called on the remote
object by the client program.




                                             http://www.java2all.com

More Related Content

What's hot (20)

Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Session bean
Session beanSession bean
Session bean
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and Drivers
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
JDBC
JDBCJDBC
JDBC
 
Query processing
Query processingQuery processing
Query processing
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
Directory structure
Directory structureDirectory structure
Directory structure
 
Servlets
ServletsServlets
Servlets
 

Similar to Java rmi

Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVAPrankit Mishra
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2Ankit Dubey
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01heenamithadiya
 
Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Nilesh Valva
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingGera Paulos
 
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
Remote method invocationRemote method invocation
Remote method invocationDew Shishir
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocationashishspace
 
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)shraddha mane
 

Similar to Java rmi (20)

Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
 
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
 
Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)
 
Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
Java rmi
Java rmiJava rmi
Java rmi
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorial
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
Rmi
RmiRmi
Rmi
 
Oracle docs rmi applications
Oracle docs rmi applicationsOracle docs rmi applications
Oracle docs rmi applications
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
Rmi
RmiRmi
Rmi
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
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)
 

More from kamal kotecha

Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods pptkamal kotecha
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with codekamal kotecha
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySqlkamal kotecha
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handlingkamal kotecha
 
String and string buffer
String and string bufferString and string buffer
String and string bufferkamal kotecha
 
Packages and inbuilt classes of java
Packages and inbuilt classes of javaPackages and inbuilt classes of java
Packages and inbuilt classes of javakamal kotecha
 
Inheritance chepter 7
Inheritance chepter 7Inheritance chepter 7
Inheritance chepter 7kamal kotecha
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in javakamal kotecha
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operatorkamal kotecha
 

More from kamal kotecha (19)

Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 
Jdbc api
Jdbc apiJdbc api
Jdbc api
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
Jsp element
Jsp elementJsp element
Jsp element
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Packages and inbuilt classes of java
Packages and inbuilt classes of javaPackages and inbuilt classes of java
Packages and inbuilt classes of java
 
Interface
InterfaceInterface
Interface
 
Inheritance chepter 7
Inheritance chepter 7Inheritance chepter 7
Inheritance chepter 7
 
Class method
Class methodClass method
Class method
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
 
Control statements
Control statementsControl statements
Control statements
 
Jsp myeclipse
Jsp myeclipseJsp myeclipse
Jsp myeclipse
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
 

Recently uploaded

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Java rmi

  • 1. RMI http://www.java2all.com
  • 2. Chapter 1 RMI Introduction http://www.java2all.com
  • 3. RMI Introduction: http://www.java2all.com
  • 4. RMI stands for “Remote Method Invocation” means communicating the object across the network. RMI is a one type of structure or system that allows an object running in one Java virtual machine (Client) to invoke methods on an object running in another Java virtual machine (Server).This object is called a Remote Object and such a system is also called RMI Distributed Application. http://www.java2all.com
  • 5. RMI provides for remote communication between programs written in the JAVA. General functioning diagram : http://www.java2all.com
  • 6. The complete RMI system has a FOUR layer, (1) Application Layer (2) Proxy Layer (3) Remote Reference Layer (4) Transport Layer Mainly the RMI application contains the THREE components, (1) RMI Server (2) RMI Client (3) RMI Registry http://www.java2all.com
  • 7. RMI Architecture: http://www.java2all.com
  • 8. The RMI Architecture (System) has a FOUR layer, (1) Application Layer (2) Proxy Layer (3) Remote Reference Layer (4) Transport Layer RMI Architecture Diagram: http://www.java2all.com
  • 10. (1) Application Layer: It’s a responsible for the actual logic (implementation) of the client and server applications. Generally at the server side class contain implementation logic and also apply the reference to the appropriate object as per the requirement of the logic in application. (2) Proxy Layer: It’s also called the “Stub/Skeleton layer”. A Stub class is a client side proxy handles the remote objects which are getting from the reference. A Skeleton class is a server side proxy that set the reference to the objects which are communicates with the Stub. http://www.java2all.com
  • 11. (3) Remote Reference Layer (RRL): It’s a responsible for manage the references made by the client to the remote object on the server so it is available on both JVM (Client and Server). The Client side RRL receives the request for methods from the Stub that is transferred into byte stream process called serialization (Marshaling) and then these data are send to the Server side RRL. The Server side RRL doing reverse process and convert the binary data into object. This process called deserialization or unmarshaling and then sent to the Skeleton class. http://www.java2all.com
  • 12. (4) Transport Layer: It’s also called the “Connection layer”. It’s a responsible for the managing the existing connection and also setting up new connections. So it is a work like a link between the RRL on the Client side and the RRL on the Server side. http://www.java2all.com
  • 13. RMI Components: http://www.java2all.com
  • 14. The RMI application contains the THREE components (1) RMI Server (2) RMI Client (3) RMI Registry http://www.java2all.com
  • 16. (1) RMI Server: RMI Server contains objects whose methods are to be called remotely. It creates remote objects and applies the reference to these objects in the Registry, after that the Registry registers these objects who are going to be called by client remotely. (2) RMI Client: The RMI Client gets the reference of one or more remote objects from Registry with the help of object name. http://www.java2all.com
  • 17. Now, it can be invokes the methods on the remote object to access the services of the objects as per the requirement of logic in RMI application. Once the client gets the reference of remote object, the methods in the remote object are invoked just like as the methods of a local object. (3) RMI Registry: In the Server side the reference of the object (which is invoked remotely) is applied and after that this reference is set in the RMI registry. http://www.java2all.com
  • 18. When the Client call the method on this object, it’s not directly call but it call by the reference which is already set in the Registry so first get the object from this reference which is available at RMI Registry then after calls the methods as per the requirement of logic in RMI application. http://www.java2all.com
  • 19. RMI Registry: http://www.java2all.com
  • 20. The RMI Registry is a naming service. RMI server programs use this service to bind the remote java object with the names. Clients executing on local or remote machines retrieve the remote objects by their name registered with the RMI registry and then execute methods on the objects. RMI creates a remote proxy for that object and sent it to clients. An object proxy contains the reference to an object. In order to work with the RMI registry... http://www.java2all.com
  • 21. 1. Start registry by using following command start rmiregistry By default the port 1099 is used by RMI registry to look up the remote objects. After the RMI registry starts objects can bind to it. 2. Now in second step to bind the remote object with the RMI registry, execute the server program. 3. To use the remote object execute the client program. http://www.java2all.com
  • 23. From the figure we can see that server calls the RMI registry to map a name with a remote object represented by black circle. By using the name of remote objects in the server's registry client program locate the remote object and then methods are called on the remote object by the client program. http://www.java2all.com