SlideShare a Scribd company logo
1 of 17
RMI ARCHITECTURE
Group Members:
Rushikesh Bosamia-130080116003
Maulik Desai-130080116009
Dhruvi Doshi-130080116011
Eva Khakhkhar -130080116012
5th sem BVM IT DEPT
Guided by:
Prof Vatsal Shah
WHAT IS RMI?
• Java Remote Method Invocation is a
mechanism for invoking methods of remote
objects.
• It facilitates communications of data as well as
invoke methods in a remote objects among
distributed objects.
LOCAL V/S REMOTE OBJECTS
invocation invocation
remote
invocation
remote
local
local
local
invocation
invocation
A
B
C
D
E
F
RMI REGISTRY
• RMI registry provides the registry services for
the server to register the object and for the
client to locate the object.
RMI REGISTRY:BINDING OBJECTS
java.rmi.registry.Registry
+bind(name: String, obj: Remote): void
+rebind(name: String, obj: Remote): void
+unbind(name: String): void
+list(name: String): String[]
+lookup(name: String): Remote
Binds the specified name with the remote object.
Binds the specified name with the remote object. Any
existing binding for the name is replaced.
Destroys the binding for the specified name that is
associated with a remote object.
Returns an array of the names bound in the registry.
Returns a reference, a stub, for the remote object
associated with the specified name.
RMI ARCHITECTURE
7
How does RMI work?
Client Host
Server
StubClient
Program
RMI Registry Host
RMI
Registry
Server Host
Server
Skeleton
Server
Object
(1) Register Server Object
(2) Look for Server Object
(3) Return
Server Stub
(4) Data
Communication
Server Object
Interface
Server Object
Interface
A subinterface of
java.rmi.Remote that
defines the methods
for the server object.
A utility that registers
remote objects and
provides naming
services for locating
objects.
An instance of the
server object
interface.
A program that invokes
the methods in the
remote server object.
An object that resides
on the client host and
serves as a surrogate
for the remote server
object.
An object that resides
on the server host,
communicates with
the stub and the actual
server object.
RMI works as follows: (1) A server object is
registered with the RMI registry; (2) A client looks
through the RMI registry for the remote object; (3)
Once the remote object is located, its stub is
returned in the client; (4) The remote object can be
used in the same way as a local object. The
communication between the client and the server is
handled through the stub and skeleton.
HOW TO CREATE AN RMI
APPLICATION?
Step 1: Define Server Object Interface
public interface ServerInterface extends Remote
{
public void service1(..)throws RemoteException;
// Other methods
}
• A server object interface must extend the
java.rmi.Remote.
Step 2: Define Server Implementation
Object
public class ServerInterfaceImpl extends UnicastRemoteObject
implements ServerInterface
{
public void service1(...) throws RemoteException
{
// Implement it
}
// Implement other methods
}
• The server implementation class must extend the
java.rmi.server.UnicastRemoteObject class.
Step 3: Create and Register Server
Object
Create a server object from the server
implementation class and register it with an RMI
registry:
Naming.rebind("RemoteObjectName", obj);
Step 4: Develop Client Program
• Develop a client that locates a remote object
and invokes its methods:
ServerInterface server = (ServerInterfaceImpl)
Naming.lookup("RemoteObjectName");
server.service1(...);
Interface
Implementation
SERVER PROGRAM
CLIENT PROGRM
RMI Architecture Overview

More Related Content

What's hot

Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAnil Kumar Pugalia
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemPoojaBele1
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
Elementary TCP Sockets
Elementary TCP SocketsElementary TCP Sockets
Elementary TCP SocketsSaksham Khurana
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating systemAli Haider
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader sonalikharade3
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Sonali Parab
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlaysmyrajendra
 
SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle Dr Neelesh Jain
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corbaMayuresh Wadekar
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networkingKikima Jimmy
 
Coda file system
Coda file systemCoda file system
Coda file systemSneh Pahilwani
 

What's hot (20)

Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Symbol Table
Symbol TableSymbol Table
Symbol Table
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Java rmi
Java rmiJava rmi
Java rmi
 
BCNF V/S 3NF
BCNF V/S 3NFBCNF V/S 3NF
BCNF V/S 3NF
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Java RMI
Java RMIJava RMI
Java RMI
 
Elementary TCP Sockets
Elementary TCP SocketsElementary TCP Sockets
Elementary TCP Sockets
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
CORBA.ppt
CORBA.pptCORBA.ppt
CORBA.ppt
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)
 
32 dynamic linking nd overlays
32 dynamic linking nd overlays32 dynamic linking nd overlays
32 dynamic linking nd overlays
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
 
SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networking
 
Coda file system
Coda file systemCoda file system
Coda file system
 

Viewers also liked

Basic java
Basic java Basic java
Basic java Raghu nath
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To RmiSwarupKulkarni
 
remote method invocation
remote method invocationremote method invocation
remote method invocationArun Nair
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theoryMukesh Tekwani
 
Java Servlets & JSP
Java Servlets & JSPJava Servlets & JSP
Java Servlets & JSPManjunatha RK
 
A brief history of cloud computing
A brief history of cloud computingA brief history of cloud computing
A brief history of cloud computingOneserve
 

Viewers also liked (15)

Java rmi
Java rmiJava rmi
Java rmi
 
Ravi Tuppad
Ravi TuppadRavi Tuppad
Ravi Tuppad
 
Java rmi
Java rmiJava rmi
Java rmi
 
Basic java
Basic java Basic java
Basic java
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To Rmi
 
Rmi
RmiRmi
Rmi
 
Java RMI
Java RMIJava RMI
Java RMI
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Networking
NetworkingNetworking
Networking
 
Rmi ppt-2003
Rmi ppt-2003Rmi ppt-2003
Rmi ppt-2003
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theory
 
Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Java Servlets & JSP
Java Servlets & JSPJava Servlets & JSP
Java Servlets & JSP
 
Java servlets
Java servletsJava servlets
Java servlets
 
A brief history of cloud computing
A brief history of cloud computingA brief history of cloud computing
A brief history of cloud computing
 

Similar to RMI Architecture Overview

Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVAPrankit Mishra
 
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
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationSabiha M
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2Ankit Dubey
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocationashishspace
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVAJalpesh Vasa
 
A Short Java RMI Tutorial
A Short Java RMI TutorialA Short Java RMI Tutorial
A Short Java RMI TutorialGuo Albert
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationSonali Parab
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01heenamithadiya
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingGera Paulos
 
#4 (Remote Method Invocation)
#4 (Remote Method Invocation)#4 (Remote Method Invocation)
#4 (Remote Method Invocation)Ghadeer AlHasan
 
Distributed objects
Distributed objectsDistributed objects
Distributed objectsSharafat Husen
 

Similar to RMI Architecture Overview (20)

Rmi
RmiRmi
Rmi
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
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)
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
DS
DSDS
DS
 
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
 
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 in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 
A Short Java RMI Tutorial
A Short Java RMI TutorialA Short Java RMI Tutorial
A Short Java RMI Tutorial
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Rmi3
Rmi3Rmi3
Rmi3
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
#4 (Remote Method Invocation)
#4 (Remote Method Invocation)#4 (Remote Method Invocation)
#4 (Remote Method Invocation)
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 

Recently uploaded

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĂŁo Esperancinha
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 

RMI Architecture Overview

  • 1. RMI ARCHITECTURE Group Members: Rushikesh Bosamia-130080116003 Maulik Desai-130080116009 Dhruvi Doshi-130080116011 Eva Khakhkhar -130080116012 5th sem BVM IT DEPT Guided by: Prof Vatsal Shah
  • 2. WHAT IS RMI? • Java Remote Method Invocation is a mechanism for invoking methods of remote objects. • It facilitates communications of data as well as invoke methods in a remote objects among distributed objects.
  • 3. LOCAL V/S REMOTE OBJECTS invocation invocation remote invocation remote local local local invocation invocation A B C D E F
  • 4. RMI REGISTRY • RMI registry provides the registry services for the server to register the object and for the client to locate the object.
  • 5. RMI REGISTRY:BINDING OBJECTS java.rmi.registry.Registry +bind(name: String, obj: Remote): void +rebind(name: String, obj: Remote): void +unbind(name: String): void +list(name: String): String[] +lookup(name: String): Remote Binds the specified name with the remote object. Binds the specified name with the remote object. Any existing binding for the name is replaced. Destroys the binding for the specified name that is associated with a remote object. Returns an array of the names bound in the registry. Returns a reference, a stub, for the remote object associated with the specified name.
  • 7. 7 How does RMI work? Client Host Server StubClient Program RMI Registry Host RMI Registry Server Host Server Skeleton Server Object (1) Register Server Object (2) Look for Server Object (3) Return Server Stub (4) Data Communication Server Object Interface Server Object Interface A subinterface of java.rmi.Remote that defines the methods for the server object. A utility that registers remote objects and provides naming services for locating objects. An instance of the server object interface. A program that invokes the methods in the remote server object. An object that resides on the client host and serves as a surrogate for the remote server object. An object that resides on the server host, communicates with the stub and the actual server object. RMI works as follows: (1) A server object is registered with the RMI registry; (2) A client looks through the RMI registry for the remote object; (3) Once the remote object is located, its stub is returned in the client; (4) The remote object can be used in the same way as a local object. The communication between the client and the server is handled through the stub and skeleton.
  • 8. HOW TO CREATE AN RMI APPLICATION?
  • 9. Step 1: Define Server Object Interface public interface ServerInterface extends Remote { public void service1(..)throws RemoteException; // Other methods } • A server object interface must extend the java.rmi.Remote.
  • 10. Step 2: Define Server Implementation Object public class ServerInterfaceImpl extends UnicastRemoteObject implements ServerInterface { public void service1(...) throws RemoteException { // Implement it } // Implement other methods } • The server implementation class must extend the java.rmi.server.UnicastRemoteObject class.
  • 11. Step 3: Create and Register Server Object Create a server object from the server implementation class and register it with an RMI registry: Naming.rebind("RemoteObjectName", obj);
  • 12. Step 4: Develop Client Program • Develop a client that locates a remote object and invokes its methods: ServerInterface server = (ServerInterfaceImpl) Naming.lookup("RemoteObjectName"); server.service1(...);