+ All Categories
Home > Documents > Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed...

Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed...

Date post: 04-Jan-2016
Category:
Upload: edward-hunter
View: 219 times
Download: 2 times
Share this document with a friend
24
Distributed Objects and Middleware
Transcript
Page 1: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Distributed Objects and Middleware

Page 2: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Sockets and Ports

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

Page 3: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Crossing Hosts/Platforms

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

Page 4: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

The Middleware layer

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

* The operating system includes basic network protocols.

Page 6: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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 7: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

A CORBA IDL Example

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

Page 8: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Local and Remote Method Invocations

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

Page 9: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

A Remote Object and Its Interface

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

Page 10: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Client Proxy (Stub) and Server Skeleton (Stub)

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

Page 11: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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 12: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Remote Interface Examples

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

Page 13: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Server Example

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

Page 14: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Server Example (cont’d)

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

Page 15: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Client Example

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

Page 16: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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 17: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

The CORBA Architecture

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

Page 18: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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 19: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

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 20: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

CORBA IDL Interfaces: Shape and ShapeList

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

Page 21: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Interface Generated from the CORBA Interface ShapeList

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

Page 22: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Implementation of Shapelist

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

Page 23: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Implementation of ShapeList (cont’d)

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

Page 24: Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.

Java Implementation of a ShapeList Client

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


Recommended