0% found this document useful (0 votes)
13 views22 pages

Final GB DC CH 02 B Rmi Chap 2

The document discusses Remote Object Invocation (RMI) as an extension of remote procedure calls, focusing on the architecture and layers involved, including the stub/skeleton layer, remote reference layer, and transport layer. It highlights the differences and similarities between RMI and RPC, emphasizing RMI's support for object-oriented programming and richer parameter-passing semantics. Additionally, it addresses issues related to communication transparency and the need for message-oriented communication in certain scenarios.

Uploaded by

2021.rishi.kokil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views22 pages

Final GB DC CH 02 B Rmi Chap 2

The document discusses Remote Object Invocation (RMI) as an extension of remote procedure calls, focusing on the architecture and layers involved, including the stub/skeleton layer, remote reference layer, and transport layer. It highlights the differences and similarities between RMI and RPC, emphasizing RMI's support for object-oriented programming and richer parameter-passing semantics. Additionally, it addresses issues related to communication transparency and the need for message-oriented communication in certain scenarios.

Uploaded by

2021.rishi.kokil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Remote Object Invocation

Book :- Suneeta Mahajan


Distributed Objects
The idea of distributed objects is an extension of the
concept of remote procedure calls.
In a system for distributed objects, the unit of
distribution is the object.
Key feature of an object::
It encapsulates State :- means the data
Method:- i.e. the operations on
the data
Methods are made available through an interface.
The separation between interfaces and the objects
implementing these interfaces is crucial for
distributed systems
Remote and
Local method invocations
Remote Method Invocation (RMI)
RMI System Architecture
Built in three layers (they are all independent):
Stub/Skeleton layer
Remote reference layer
Transport layer
RMI Layers
Stub/Skeleton Layer
The interface between the application layer
and the rest of the system
Stubs and skeletons are generated using the
RMIC compiler
This layer transmits data to the remote
reference layer via the abstraction of marshal
streams (that use object serialization)
This layer doesn’t deal with the specifics of
any transport
Stub/Skeleton Layer
Client stub responsible for:
 Initiate remote calls
 Marshal arguments to be sent
 Inform the remote reference layer to invoke the
call
 Unmarshaling the return value
 Inform remote reference the call is complete
Server skeleton responsible for:
 Unmarshaling incoming arguments from client
 Calling the actual remote object
implementation
 Marshaling the return value for transport back
to client
Remote Reference Layer
The middle layer
Provides the ability to support varying remote
reference or invocation protocols independent
of the client stub and server skeleton
Example:
Unicast protocol provides point-to-point
invocation,
Multicast provides invocation to replicated
groups of objects
Other protocols may deal with different
strategies….
The Transport Layer
A low-level layer that ships serialized objects
between different address spaces
Responsible for:
Setting up connections to remote address
spaces
Managing the connections
Listening to incoming calls
Maintaining a table of remote objects that
reside in the same address space
Setting up connections for an incoming call
Locating the dispatcher for the target of the
remote call
Flow diagram for RMI
Client invokes
method on the Remote Object
remote object

Stub/Proxy Skeleton

Remote Reference Remote Reference


Layer (RRL) Layer
Converts the method to a Converts message to remote
message object

TCP/IP
RMI working
An invocation will pass through the
stub/skeleton layer, which will transfer data
to the remote reference layer
The semantics of the invocation are carried
to the transport layer
The transport layer is responsible for setting
up the connection
Naming Registry
The remote object must register itself with
the RMI naming registry
A reference to the remote object is obtained
by the client by looking up the registry
RMI Process
Remote Method Invocation (RMI)- Binding
 After the client is bound to an object, it can
invoke the objects methods through the
proxy .

 This way of invocation is called the RMI.


Parameter Passing
Parameter Passing
 Parameter passing is less restricted that RPC as
RMI supports system wide object references.
 As shown in figure,
 Client program is running on machine A , having
reference to local object O1 that it uses as
parameter (call by parameter) when calling the
server program
 Server program is on machine C, having reference
to local object O2 in machine B.
 When calling the server, a copy of O1 is passed to
the server on machine C, along with only a copy of
reference to O2.
RMI Invocation Semantics
1. Maybe Semantics :-
With this, the client may not know whether the remote
method is
executed once or not at all.
2. At-least once semantics :-
The invoker receives the result, implying that the server
has executed the method atleast once or an exception
informing that no result was received.
3. At-most once semantics :-
The client receives the result, implying that the method
executes exactly once, or an exception informing that no
result was received so far.
Remote Method Invocation (RMI)
To support RMI, one needs to :-
Specify objects interface in IDL or
Static invocation :-
Implies using object-based languages
(e.g., Java) to predefine interface
definitions.
Dynamic invocation :-
Permits composing a method
invocation at run-time
RPC & RMI: Similarities
Both:-

 Support programming with interfaces

 Are typically constructed on top of request-


reply protocols

 Offer a similar level of transparency –


i.e. local and remote calls employ the same
syntax but remote interfaces typically expose
the distributed nature of the underlying call
RPC & RMI: Differences
The programmer is able to use the full expressive
power of object-oriented programming in the
development of distributed systems software.
Building on the concept of object identity in
object-oriented systems, all objects in an RMI-
based system have unique object references.
 Object references can be passed as parameters thus
offering significantly richer parameter-passing
semantics than in RPC.
 Major difference between RMI and RPC is that:-
1. RMI supports system wide object references.
2. Object specific stubs can be incorporated in RMI
Issues wrt RPC and RMI
1. RPC and RMI , hide communication in DS and enhance transparency.

However, neither mechanism is always appropriate.


2. When it cannot be assumed that the receiving side is executing at the
same time a request is sent, alternative communication serves are
needed.
3. An alternative to client being blocked till its request is processed , is also
required.

Solution is….
Message oriented communication

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy