SlideShare a Scribd company logo
9
Most read
10
Most read
16
Most read
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)

PPTX
Event Handling in java
Google
 
PPTX
Namespaces in C#
yogita kachve
 
PDF
JSP Components and Directives.pdf
Arumugam90
 
PPTX
Jdbc ppt
sandeep54552
 
PPS
Wrapper class
kamal kotecha
 
PDF
The Object Model
yndaravind
 
PPT
Introduction to c#
OpenSource Technologies Pvt. Ltd.
 
PPTX
Java Notes by C. Sreedhar, GPREC
Sreedhar Chowdam
 
PPT
Java Networking
Sunil OS
 
PDF
Distributed Systems Naming
Ahmed Magdy Ezzeldin, MSc.
 
PPTX
Exception handling
PhD Research Scholar
 
PPT
Collection Framework in java
CPD INDIA
 
PPTX
trigger dbms
kuldeep100
 
PPTX
Overview of UML Diagrams
Manish Kumar
 
PPTX
Object oriented database concepts
Temesgenthanks
 
PPTX
Common language runtime clr
SanSan149
 
PDF
Remote Method Invocation (RMI)
Peter R. Egli
 
PPT
Java Servlets
BG Java EE Course
 
PPTX
Inheritance in java
Tech_MX
 
Event Handling in java
Google
 
Namespaces in C#
yogita kachve
 
JSP Components and Directives.pdf
Arumugam90
 
Jdbc ppt
sandeep54552
 
Wrapper class
kamal kotecha
 
The Object Model
yndaravind
 
Introduction to c#
OpenSource Technologies Pvt. Ltd.
 
Java Notes by C. Sreedhar, GPREC
Sreedhar Chowdam
 
Java Networking
Sunil OS
 
Distributed Systems Naming
Ahmed Magdy Ezzeldin, MSc.
 
Exception handling
PhD Research Scholar
 
Collection Framework in java
CPD INDIA
 
trigger dbms
kuldeep100
 
Overview of UML Diagrams
Manish Kumar
 
Object oriented database concepts
Temesgenthanks
 
Common language runtime clr
SanSan149
 
Remote Method Invocation (RMI)
Peter R. Egli
 
Java Servlets
BG Java EE Course
 
Inheritance in java
Tech_MX
 

Similar to Java rmi (20)

PPTX
Remote Method Innovation (RMI) In JAVA
Prankit Mishra
 
PDF
Module 3 remote method invocation-2
Ankit Dubey
 
PPT
Remote method invocation
MNM Jain Engineering College
 
PPTX
Java RMI
Prajakta Nimje
 
PPSX
Javarmi 130925082348-phpapp01
heenamithadiya
 
PPSX
Java rmi
Tanmoy Barman
 
PDF
Remote Method Invocation in JAVA
Jalpesh Vasa
 
PPTX
Java RMI(Remote Method Invocation)
Nilesh Valva
 
PDF
Remote Method Invocation, Advanced programming
Gera Paulos
 
PPTX
Remote Method Invocation (Java RMI)
Sonali Parab
 
PPTX
Remote method invocatiom
sakthibalabalamuruga
 
DOCX
Java rmi
Namomsa Amanuu
 
PDF
Java rmi tutorial
HarikaReddy115
 
PDF
RMI (Remote Method Invocation)
Thesis Scientist Private Limited
 
PDF
Rmi
vantinhkhuc
 
DOCX
Oracle docs rmi applications
Biswabrata Banerjee
 
PPTX
Remote method invocation
Dew Shishir
 
PDF
Remote Method Invocation
ashishspace
 
DOCX
ADB Lab Manual.docx
SaiKumarPrajapathi
 
PPTX
Rmi
Vijay Kiran
 
Remote Method Innovation (RMI) In JAVA
Prankit Mishra
 
Module 3 remote method invocation-2
Ankit Dubey
 
Remote method invocation
MNM Jain Engineering College
 
Java RMI
Prajakta Nimje
 
Javarmi 130925082348-phpapp01
heenamithadiya
 
Java rmi
Tanmoy Barman
 
Remote Method Invocation in JAVA
Jalpesh Vasa
 
Java RMI(Remote Method Invocation)
Nilesh Valva
 
Remote Method Invocation, Advanced programming
Gera Paulos
 
Remote Method Invocation (Java RMI)
Sonali Parab
 
Remote method invocatiom
sakthibalabalamuruga
 
Java rmi
Namomsa Amanuu
 
Java rmi tutorial
HarikaReddy115
 
RMI (Remote Method Invocation)
Thesis Scientist Private Limited
 
Oracle docs rmi applications
Biswabrata Banerjee
 
Remote method invocation
Dew Shishir
 
Remote Method Invocation
ashishspace
 
ADB Lab Manual.docx
SaiKumarPrajapathi
 
Ad

More from kamal kotecha (20)

PPS
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
PPTX
Network programming in java - PPT
kamal kotecha
 
PPT
Java servlet life cycle - methods ppt
kamal kotecha
 
PPS
Java rmi example program with code
kamal kotecha
 
PPS
Jdbc example program with access and MySql
kamal kotecha
 
PPS
Jdbc api
kamal kotecha
 
PPS
Jdbc architecture and driver types ppt
kamal kotecha
 
PPS
Java Exception handling
kamal kotecha
 
PPS
JSP Error handling
kamal kotecha
 
PPS
Jsp element
kamal kotecha
 
PPS
Jsp chapter 1
kamal kotecha
 
PPS
String and string buffer
kamal kotecha
 
PPS
Packages and inbuilt classes of java
kamal kotecha
 
PPS
Interface
kamal kotecha
 
PPS
Inheritance chepter 7
kamal kotecha
 
PPS
Class method
kamal kotecha
 
PPS
Introduction to class in java
kamal kotecha
 
PPS
Control statements
kamal kotecha
 
PPTX
Jsp myeclipse
kamal kotecha
 
PPTX
basic core java up to operator
kamal kotecha
 
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
Network programming in java - PPT
kamal kotecha
 
Java servlet life cycle - methods ppt
kamal kotecha
 
Java rmi example program with code
kamal kotecha
 
Jdbc example program with access and MySql
kamal kotecha
 
Jdbc api
kamal kotecha
 
Jdbc architecture and driver types ppt
kamal kotecha
 
Java Exception handling
kamal kotecha
 
JSP Error handling
kamal kotecha
 
Jsp element
kamal kotecha
 
Jsp chapter 1
kamal kotecha
 
String and string buffer
kamal kotecha
 
Packages and inbuilt classes of java
kamal kotecha
 
Interface
kamal kotecha
 
Inheritance chepter 7
kamal kotecha
 
Class method
kamal kotecha
 
Introduction to class in java
kamal kotecha
 
Control statements
kamal kotecha
 
Jsp myeclipse
kamal kotecha
 
basic core java up to operator
kamal kotecha
 
Ad

Recently uploaded (20)

PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
PPTX
Introduction to Probability(basic) .pptx
purohitanuj034
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
PPTX
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
PPT
DRUGS USED IN THERAPY OF SHOCK, Shock Therapy, Treatment or management of shock
Rajshri Ghogare
 
PPTX
Rules and Regulations of Madhya Pradesh Library Part-I
SantoshKumarKori2
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PDF
BÀI TáșŹP TEST BỔ TRỹ THEO Tá»ȘNG CHỊ ĐỀ CỊA Tá»ȘNG UNIT KÈM BÀI TáșŹP NGHE - TIáșŸNG A...
Nguyen Thanh Tu Collection
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
Introduction to Probability(basic) .pptx
purohitanuj034
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
DRUGS USED IN THERAPY OF SHOCK, Shock Therapy, Treatment or management of shock
Rajshri Ghogare
 
Rules and Regulations of Madhya Pradesh Library Part-I
SantoshKumarKori2
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
BÀI TáșŹP TEST BỔ TRỹ THEO Tá»ȘNG CHỊ ĐỀ CỊA Tá»ȘNG UNIT KÈM BÀI TáșŹP NGHE - TIáșŸNG A...
Nguyen Thanh Tu Collection
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 

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