inf 123 sw arch, dist sys & interop lecture 9 prof. crista lopes

12
INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Upload: august-murphy

Post on 17-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

INF 123 SW ARCH, DIST SYS & INTEROP

LECTURE 9

Prof. Crista Lopes

Page 2: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Objectives

Understanding of Distributed Objects architectures

Acquaintance with a well-known RMI framework Java RMI

Page 3: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Web Services isa Distributed System

“Collection of interacting components hosted on different computers that are connected through a computer network”

Component1

Component n

Hardware

Network OS

Host 3

Component1

Component n

Hardware

Network OS

Host 2

Component1

Component n

Hardware

Network OS

Host 1

Network

Page 4: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Remote Procedure Calls (RPC)

r = foo(a, b)

define foo(a, b) …end

caller

callee

program

host

Local Procedure Calls

r = foo(a, b)

define foo(a, b) …end

caller

callee

program

host 1

host 2program

Remote Procedure Calls

Page 5: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Remote Procedure Calls (RPC)

r = foo(a, b)

define foo(a, b) …end

caller

callee

program

host

Local Procedure Calls

r = foo(a, b)

define foo(a, b) …end

caller

callee

program

host 1

host 2program

Remote Procedure Calls

Stub

Skeleton

Page 6: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

RPC

Procedure Interface Definition (in IDL)

Procedure Definition Program (in PL)

Procedure Call Program (in PL)

Stub(in PL)

Skeleton(in PL)

generates

Network OS Network OS

Page 7: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

RPC Stubs

Marshal arguments (i.e. “serialize”) Issue request to remote server, wait for

response Unmarshal return value (i.e.

“deserialize”)

Page 8: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

RPC Skeletons

Unmarshal arguments Call local procedure Marshal return value Send back response to client

Page 9: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Distributed Objects model

Obj1

Host A

Obj2

Host A

Obj4

Host A

Obj5

Host A

Obj3

Obj6

Page 10: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Distributed Objects model

Obj1Obj2

Obj4

Obj5

Obj3

Obj6

“Transparent distribution”

Page 11: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Distributed Objects – Properties Very tightly coupled with PL

Compiler generates stubs and skeletons Distribution seen only in terms of

peripheral components: Security Registry Additional program arguments

Location (host) doesn’t matter [much] Remote object references do

Page 12: INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes

Rest of this lecture

Java RMI tutorial athttp://java.sun.com/docs/books/tutorial/rmi/overview.html