Chapter 5 Distributed Systems
Chapter 5 Distributed Systems
Chapter 5 Distributed Systems
CHAPTER-5(UNIT-2)
MIDDLEWARE
Software that provides a programming model above the basic
building blocks of processes and message passing is called
middleware
It uses protocols based on messages between processes to provide
its higher level abstractions such as remote invocations and events
Example remote invocation abstraction is based on the request
reply protocol
The important aspects of middleware are
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
Object B and F are remote objects and they must have remote
interface
the remote object to receive a remote method invocation is
specified by the invoker as a remote object reference
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
SV COLLEGES
CHAPTER-5(UNIT-2)
Skeleton:
Each class representing a remote object has a
skeleton in the server to implement each method in
the remote interface.
Unmarshal the argument in the request message
and invoke the corresponding method in the remote
object.
Await the invocation to complete to marshal the
result in the reply message to the client proxys
method.
The classes of the proxy, skeleton, and dispatcher used
in RMI are generated automatically by an interface
complier.
The server program contains the classes for the
dispatchers and skeletons together with the
implementations of the classes of all remote objects
that it supports servant classes.
The client program contains the classes of the proxies
for all the remote objects that it will invoke and use a
binder to look up remote object references.
D.ABHISHEKH MSSE
SV COLLEGES
CHAPTER-5(UNIT-2)
D.ABHISHEKH MSSE
SV COLLEGES
10
CHAPTER-5(UNIT-2)
Dealers
Dealer
Dealers
Notification
Notification
Notification
Information
provider Notification
Notification
Dealers
Notification
Notification
Notification
Dealer
Notification
Dealer
Dealers
Information
provider
Notification
Dealer
Externa
sourc
D.ABHISHEKH MSSE
SV COLLEGES
11
CHAPTER-5(UNIT-2)
Client
Server
Stubs
Skeletons
Remote
Reference
Remote
Reference
Transport
There are three layers that comprise the basic remoteobject communication facilities in RMI:
1. The stub/skeleton layer, which provides the
interface that client and server application objects
use to interact with each other.
D.ABHISHEKH MSSE
SV COLLEGES
12
CHAPTER-5(UNIT-2)
2.
3.
D.ABHISHEKH MSSE
SV COLLEGES
13
CHAPTER-5(UNIT-2)
5.
The remote reference layer converts the client request into lowlevel RMI transport requests, i.e., into a single network-level
request and sends it over the wire to the sole remote object
that corresponds to the remote reference passed along with the
request.
6.
7.
8.
The result is sent back using the appropriate transport protocol (e.g.
Socket API using TCP/IP), where it passes through the client reference
layer and stub, is unmarshaled by the stub, and is finally handed back to
the client thread that invoked the remote method.
D.ABHISHEKH MSSE
SV COLLEGES
14
CHAPTER-5(UNIT-2)
RMI REGISTRY
Naming/Registry Service
A server process needs to register one (or more) RMIenabled objects with its local RMI registry (represented by
the Registry interface) using a name that clients can use to
reference it.
A client can obtain a stub reference to the remote object by
asking for the object by name through the Naming interface.
The Naming.lookup() method takes the name of a remote
object and locates the object on the network. The objects
name is in a URL-like syntax that includes the name of the
objects host and the objects registered name.
Once the lookup() method locates the objects host, it
consults the RMI registry on the host and asks for the object
by name. If the registry finds the object, it generates a
remote reference to the object and delivers it to the client
process, where it is converted into a stub (local) reference
that is returned to the caller.
FORMAT: rmi//ComputerName/ObjectService
D.ABHISHEKH MSSE
SV COLLEGES