SlideShare a Scribd company logo
1 of 28
RMI-Remote Method Invocation
M.Jagadeesh, Assistant Professor, Information Technology,
MNM Jain Engineering College, Chennai
What is RMI?
 RMI stands for Remote Method Invocation. It is a
mechanism that allows an object residing in one
system (JVM) to access/invoke an object running
on another JVM.
 RMI is used to build distributed applications; it
provides remote communication between Java
programs. It is provided in the package java.rmi.
 Remote objects must be written in Java
 object-oriented (Object provide methods). objects
on different computers can interact in a distributed
network.
 RMI basically provides remote object access for a
client and object registration for servers.
RMI Components
 Client: The client looks
up a remote object and
calls methods on the
obtained remote object.
 Server: The server
registers itself in the RMI
registry and accepts
method invocations from
the client.
 RMI Registry: The
registry is a remote
object lookup service.
What is RMI Registry?
Essentially the RMI registry is a place for the server to
register services it offers and a place for clients to query
for those services.
Firstly, the client must contact an RMI registry, and
request the name of the service.
This will point him in the direction of the service he
wants to call.
RMI Registry acts a broker between RMI servers and the
clients. The server "registers" its services in the registry
- hence a RMI Registry can act as a "directory" for many
servers/services. The client does not need to know the
location of individual servers, and does a lookup on the
RMI Registry for the service it needs. The registry, being
a naming directory returns the appropriate handle to the
client to invoke methods on.
Architecture of an RMI
 Each time the server creates an object, it registers this object
with the RMIregistry (using bind() or reBind() methods).
 To invoke a remote object, the client needs a reference of that
object. At that time, the client fetches the object from the
registry using its bind name (using lookup() method).
Architecture of an RMI
Understanding stub and skeleton
stub
The stub is an object, acts as a gateway for the client side.
All the outgoing requests are routed through it.
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:
1.It initiates a connection with remote Virtual Machine (JVM),
2.It writes and transmits (marshals) the parameters to the
remote Virtual Machine (JVM),
3.It waits for the result
4.It reads (unmarshals) the return value or exception, and
5.It finally, returns the value to the caller.
skeleton
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:
1.It reads the parameter for the remote method
2.It invokes the method on the actual remote object, and
3.It writes and transmits (marshals) the result to the caller.
What is an interface in Java?
Interface looks like a class but it is not a class. An interface
can have methods and variables just like the class but the
methods declared in interface are by default abstract (only
method signature, no body, see: Java abstract method).
Also, the variables declared in an interface are public, static
& final by default.
What is the use of interface in Java?
As mentioned above they are used for full abstraction.
Since methods in interfaces do not have body, they have to
be implemented by the class before you can access them.
The class that implements interface must implement all the
methods of that interface. Also, java programming
language does not allow you to extend more than one
class, However you can implement more than one
interfaces in your class.
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation
Remote method invocation

More Related Content

What's hot

Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
Cs556 section2
Cs556 section2Cs556 section2
Cs556 section2farshad33
 
Multiuser chat application using java
Multiuser chat application using javaMultiuser chat application using java
Multiuser chat application using javaasifnoman240
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagarNitish Nagar
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess CommunicationDeepak H L
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat applicationSamsil Arefin
 
Mail server_Synopsis
Mail server_SynopsisMail server_Synopsis
Mail server_SynopsisManmeet Sinha
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Conceptspasam suresh
 
dotnet_remoting
dotnet_remotingdotnet_remoting
dotnet_remotingOPENLANE
 
Operating system support in distributed system
Operating system support in distributed systemOperating system support in distributed system
Operating system support in distributed systemishapadhy
 

What's hot (20)

Multi user chat system using java
Multi user chat system using javaMulti user chat system using java
Multi user chat system using java
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Cs556 section2
Cs556 section2Cs556 section2
Cs556 section2
 
Multiuser chat application using java
Multiuser chat application using javaMultiuser chat application using java
Multiuser chat application using java
 
Chat application
Chat applicationChat application
Chat application
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
 
Rmi
RmiRmi
Rmi
 
Chat server
Chat server Chat server
Chat server
 
PyNet
PyNetPyNet
PyNet
 
Java servlets
Java servletsJava servlets
Java servlets
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
Active Object
Active ObjectActive Object
Active Object
 
Client server chat application
Client server chat applicationClient server chat application
Client server chat application
 
Mail server_Synopsis
Mail server_SynopsisMail server_Synopsis
Mail server_Synopsis
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
dotnet_remoting
dotnet_remotingdotnet_remoting
dotnet_remoting
 
Operating system support in distributed system
Operating system support in distributed systemOperating system support in distributed system
Operating system support in distributed system
 
Ipc
IpcIpc
Ipc
 

Similar to Remote method invocation

Similar to Remote method invocation (20)

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 Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Java rmi
Java rmiJava rmi
Java rmi
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
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(Remote Method Invocation)
Java RMI(Remote Method Invocation)Java RMI(Remote Method Invocation)
Java RMI(Remote Method Invocation)
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorial
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
Java rmi
Java rmiJava rmi
Java rmi
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
Basic java
Basic java Basic java
Basic java
 

More from MNM Jain Engineering College (16)

IT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docxIT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docx
 
IT8602 Syllabus.pdf
IT8602 Syllabus.pdfIT8602 Syllabus.pdf
IT8602 Syllabus.pdf
 
Mg8591 syllabus
Mg8591 syllabusMg8591 syllabus
Mg8591 syllabus
 
Ccse ii model_qp
Ccse ii model_qpCcse ii model_qp
Ccse ii model_qp
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Task assignment approach
Task assignment approachTask assignment approach
Task assignment approach
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Engineering Ethics
Engineering EthicsEngineering Ethics
Engineering Ethics
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
It6312 dbms lab-ex2
It6312 dbms lab-ex2It6312 dbms lab-ex2
It6312 dbms lab-ex2
 
Expected questions in Artificial Intelligence
Expected questions in Artificial IntelligenceExpected questions in Artificial Intelligence
Expected questions in Artificial Intelligence
 
Qp mobile & pervasive 2015
Qp mobile & pervasive 2015Qp mobile & pervasive 2015
Qp mobile & pervasive 2015
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
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
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 

Remote method invocation

  • 1. RMI-Remote Method Invocation M.Jagadeesh, Assistant Professor, Information Technology, MNM Jain Engineering College, Chennai
  • 2. What is RMI?  RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM.  RMI is used to build distributed applications; it provides remote communication between Java programs. It is provided in the package java.rmi.  Remote objects must be written in Java  object-oriented (Object provide methods). objects on different computers can interact in a distributed network.  RMI basically provides remote object access for a client and object registration for servers.
  • 3. RMI Components  Client: The client looks up a remote object and calls methods on the obtained remote object.  Server: The server registers itself in the RMI registry and accepts method invocations from the client.  RMI Registry: The registry is a remote object lookup service.
  • 4. What is RMI Registry? Essentially the RMI registry is a place for the server to register services it offers and a place for clients to query for those services. Firstly, the client must contact an RMI registry, and request the name of the service. This will point him in the direction of the service he wants to call. RMI Registry acts a broker between RMI servers and the clients. The server "registers" its services in the registry - hence a RMI Registry can act as a "directory" for many servers/services. The client does not need to know the location of individual servers, and does a lookup on the RMI Registry for the service it needs. The registry, being a naming directory returns the appropriate handle to the client to invoke methods on.
  • 5. Architecture of an RMI  Each time the server creates an object, it registers this object with the RMIregistry (using bind() or reBind() methods).  To invoke a remote object, the client needs a reference of that object. At that time, the client fetches the object from the registry using its bind name (using lookup() method).
  • 7. Understanding stub and skeleton stub The stub is an object, acts as a gateway for the client side. All the outgoing requests are routed through it. 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: 1.It initiates a connection with remote Virtual Machine (JVM), 2.It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM), 3.It waits for the result 4.It reads (unmarshals) the return value or exception, and 5.It finally, returns the value to the caller.
  • 8. skeleton 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: 1.It reads the parameter for the remote method 2.It invokes the method on the actual remote object, and 3.It writes and transmits (marshals) the result to the caller.
  • 9. What is an interface in Java? Interface looks like a class but it is not a class. An interface can have methods and variables just like the class but the methods declared in interface are by default abstract (only method signature, no body, see: Java abstract method). Also, the variables declared in an interface are public, static & final by default. What is the use of interface in Java? As mentioned above they are used for full abstraction. Since methods in interfaces do not have body, they have to be implemented by the class before you can access them. The class that implements interface must implement all the methods of that interface. Also, java programming language does not allow you to extend more than one class, However you can implement more than one interfaces in your class.