interprocess communication and middleware

28
Interprocess Communication and Middleware

Upload: questa

Post on 17-Jan-2016

23 views

Category:

Documents


1 download

DESCRIPTION

Interprocess Communication and Middleware. Sockets and Ports. Node 2. Node 1. Source: G. Coulouris et al., Distributed Systems: Concepts and Design. Crossing Hosts/Platforms. Source: G. Coulouris et al., Distributed Systems: Concepts and Design. Provisions of Middleware. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Interprocess Communication and Middleware

Interprocess Communicationand

Middleware

Page 2: Interprocess Communication and Middleware

Sockets and Ports

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Node 1 Node 2

Page 3: Interprocess Communication and Middleware

Crossing Hosts/Platforms

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 4: Interprocess Communication and Middleware

Provisions of Middleware

• Higher-level abstractions (RPC, RMI, …)

• Location transparency

• Independent of communication protocols

• Independent of hardware/operating systems

• Use of several programming languages

Page 5: Interprocess Communication and Middleware

The Middleware layer

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

* The operating system includes common network protocols (TCP/IP, …).

Page 6: Interprocess Communication and Middleware

Request-Reply Communication

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 7: Interprocess Communication and Middleware

Request-Reply Communication Using HTTP

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

HTTP request message:

HTTP reply message:

Page 8: Interprocess Communication and Middleware

Serialization (Marshalling)

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 9: Interprocess Communication and Middleware

Distributed Objects

The object-based programming model is extended

to allow objects in different processes to interact

with one another.• Client/Server• Object References• Interfaces• Remote Method Invocation• Exceptions

Page 10: Interprocess Communication and Middleware

A CORBA IDL Example

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 11: Interprocess Communication and Middleware

Local and Remote Method Invocations

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 12: Interprocess Communication and Middleware

A Remote Object and Its Interface

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 13: Interprocess Communication and Middleware

Client Proxy (Stub) and Server Skeleton (Stub)

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 14: Interprocess Communication and Middleware

The RMI Software

• Proxy: the local representative of the remote object.

• Dispatcher: relays a request to the appropriate skeleton method.

• Skeleton: unmarshals the request and invokes the corresponding method in the remote object.

Page 15: Interprocess Communication and Middleware

RPC/RMI Semantics

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 16: Interprocess Communication and Middleware

Java Remote Interfaces

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 17: Interprocess Communication and Middleware

A Java Server

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 18: Interprocess Communication and Middleware

A Java Server (cont’d)

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 19: Interprocess Communication and Middleware

A Java Client

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 20: Interprocess Communication and Middleware

CORBA

• Defined by OMG to hide the intricacies of network programming.

• An ORB (Object Request Broker) receives invocations from a client and deliver them to a target object.

• The main communication protocol is GIOP (General Inter-ORB Protocol), known as IIOP when implemented over the Internet.

Page 21: Interprocess Communication and Middleware

The CORBA Architecture

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 22: Interprocess Communication and Middleware

CORBA Object Interfaces

• Each object has an interface defined in IDL.

• An interface defines the operations that can be called by the clients.

• An interface can be implemented in one language and called from by another.

• The CORBA IDL includes features such as inheritance of interfaces, exceptions, and compound data types.

Page 23: Interprocess Communication and Middleware

CORBA Programming with Java

• Define the interfaces using IDL and compile them into Java interfaces.

• Implement the interfaces with Java classes.

• Write a server main function that creates instances of these classes and then inform the underlying CORBA implementation.

• Register the server.

• Write a client main function to connect to the server and to use server’s objects.

Page 24: Interprocess Communication and Middleware

CORBA IDL Interfaces: Shape and ShapeList

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 25: Interprocess Communication and Middleware

Java Interface Generated from the CORBA Interface ShapeList

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 26: Interprocess Communication and Middleware

Java Implementation of Shapelist

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 27: Interprocess Communication and Middleware

Java Implementation of ShapeList (cont’d)

Source: G. Coulouris et al., Distributed Systems: Concepts and Design

Page 28: Interprocess Communication and Middleware

Java Implementation of a ShapeList Client

Source: G. Coulouris et al., Distributed Systems: Concepts and Design