120 likes | 211 Views
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. Web Services isa Distributed System.
E N D
INF 123 SW Arch, dist sys & interopLecture 9 Prof. Crista Lopes
Objectives • Understanding of Distributed Objects architectures • Acquaintance with a well-known RMI framework • Java RMI
Web Services isa Distributed System • “Collection of interactingcomponentshosted on different computers that are connected through a computer network” … Component n Component n Component n Component1 Component1 Component1 Network Network OS Network OS Network OS Hardware Hardware Hardware Host 2 Host 1 Host 3
Remote Procedure Calls (RPC) Local Procedure Calls Remote Procedure Calls host 1 host program program caller caller r = foo(a, b) r = foo(a, b) host 2 callee program callee define foo(a, b) … end define foo(a, b) … end
Remote Procedure Calls (RPC) Local Procedure Calls Remote Procedure Calls host 1 host program program caller caller r = foo(a, b) r = foo(a, b) Stub host 2 callee program Skeleton callee define foo(a, b) … end define foo(a, b) … end
RPC Procedure Call Program (in PL) Procedure Interface Definition (in IDL) Procedure Definition Program (in PL) generates Stub (in PL) Skeleton (in PL) Network OS Network OS
RPC Stubs • Marshal arguments (i.e. “serialize”) • Issue request to remote server, wait for response • Unmarshal return value (i.e. “deserialize”)
RPC Skeletons • Unmarshal arguments • Call local procedure • Marshal return value • Send back response to client
Distributed Objects model Obj2 Obj1 Obj3 Host A Host A Obj5 Obj4 Obj6 Host A Host A
Distributed Objects model Obj2 Obj1 Obj3 Obj5 Obj4 Obj6 “Transparent distribution”
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
Rest of this lecture • Java RMI tutorial athttp://java.sun.com/docs/books/tutorial/rmi/overview.html