Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

REMOTE

METHOD
INVOCATION
[RMI]
INTRODUCTION
• Remote object invocation technique used to locate and fetch object at
remote side using object reference.

• Implementation of Remote Procedure Call (RPC) with added support for


object transmission.

• Facilitates remote communication between applications using two key


objects: stub (client-side) and skeleton (server-side).
STRUCTURE OF MESSAGE
MESSAGE REQUEST ID OBJECT METHOD ID ARGUMENTS
TYPE REFERENCE

STRUCTURE OF REMOTE OBJECT


REFRENCE
IP ADDRESS PORT TIMING OBJECT INTERFACE
NUMBER NUMBER REMOTE
OBJECT
IMPLEMENTATION ON RMI
1) Communication Module:
Function: Operates using a request-reply protocol between client and server.

Responsibilities:
• Enforces invocation semantics like at-most-once.
• Passes the remote reference in the request to the remote reference module,
which returns the local reference.
• Selects the dispatcher for the class of the object to be invoked and passes
on the local reference.

2) Remote Reference Module:


Function: Translates between remote and local references by looking them up in a
remote object table.

Remote Object Table Contains:


• Each remote object held by the server's remote reference module.
• Each local proxy at the client's remote reference module.
Components:
• Proxy: Acts as a normal object in the client process, forwards
invocations to the remote object after marshalling arguments, and
unmarshals results to pass to the client.

• Dispatcher: Exists for each class representing a remote object,


receives requests from the communication module.

• Skeleton: Implements methods in the remote interface, responsible


for marshalling/unmarshalling arguments and results, and passes
them to the servant.

• Servant: An instance of a class providing the body to a remote


object, handles remote requests passed by the skeleton.
SERVER FLOWCHART
CLIENT FLOWCHART
Server-side
Client-side
output
CONCLUSION

In summary, the provided remote_object.py and client.py scripts demonstrate a simple


implementation of Remote Method Invocation (RMI) using the Pyro5 library in Python. The
server script sets up a remote object with an exposed method and runs a Pyro5 daemon to
listen for incoming calls. The client script reads the server's URI from a file, creates a proxy to
the remote object, and invokes its method. This setup allows remote method calls between the
client and server, showcasing the basic principles of RMI in Python.

You might also like