Presentation is loading. Please wait.

Presentation is loading. Please wait.

Information Management NTU Interprocess Communication and Middleware.

Similar presentations


Presentation on theme: "Information Management NTU Interprocess Communication and Middleware."— Presentation transcript:

1 Information Management NTU Interprocess Communication and Middleware

2 Information Management NTU Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design Node 1 Node 2

3 Information Management NTU Crossing Hosts/Platforms Source: G. Coulouris et al., Distributed Systems: Concepts and Design

4 Information Management NTU Purposes of Middleware Higher-level abstractions (RPC, RMI, …) Location transparency Independent of communication protocols Independent of hardware/operating systems Use of several programming languages

5 Information Management NTU Local vs. Remote Modules Variables  Variables of a remote module cannot be directly accessed. Parameter-passing Mechanisms  Call by reference, for input parameters, is not feasible for a remote procedure/method. Pointers  Pointers of a remote module are not very useful for the local module. * For a module in some process, any other module in a different process, not necessarily a different computer, is a remote module.

6 Information Management NTU The Middleware layer Source: G. Coulouris et al., Distributed Systems: Concepts and Design * The operating system includes common network protocols (TCP/IP, …).

7 Information Management NTU Marshalling (Serialization) in CORBA CDR Source: G. Coulouris et al., Distributed Systems: Concepts and Design

8 Information Management NTU Request-Reply Communication Source: G. Coulouris et al., Distributed Systems: Concepts and Design

9 Information Management NTU Request-Reply Communication Using HTTP Source of figures: G. Coulouris et al., Distributed Systems: Concepts and Design An HTTP request message: An HTTP reply message: HTTP is not only a request-reply protocol but also has been used as the transport of other request-reply protocols.

10 Information Management NTU Distributed Objects Client/Server: two-tier, three-tier, … Interfaces and Interface Definition Languages (IDLs) Object References (or Identifiers) and Remote Method Invocation (RMI) Object Activations and Persistency Exceptions: timeouts, … Synchronization, Replication, Migration, Garbage Collection, …

11 Information Management NTU Interactions among Distributed Objects Source: G. Coulouris et al., Distributed Systems: Concepts and Design

12 Information Management NTU A Remote Object and Its Interface Source: G. Coulouris et al., Distributed Systems: Concepts and Design

13 Information Management NTU A CORBA IDL Example Source: G. Coulouris et al., Distributed Systems: Concepts and Design

14 Information Management NTU Client Proxy and Server Skeleton Source: G. Coulouris et al., Distributed Systems: Concepts and Design A client proxy is also known as a client stub and server skeleton as server stub. The remote reference module is mainly for translating between local and remote object references.

15 Information Management NTU 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. These RMI components are generated automatically by an interface compiler.

16 Information Management NTU RMI/RPC Semantics and Transparency Source of the table: G. Coulouris et al., Distributed Systems: Concepts and Design Remote invocations may be made syntactically identical to local invocations, but they have far more implications that both the client and the server designers have to deal with.

17 Information Management NTU Event-Based Systems The publish-subscribe paradigm  publisher  event and event type  subscriber  notification Heterogeneity Asynchrony

18 Information Management NTU A Dealing Room System Source: G. Coulouris et al., Distributed Systems: Concepts and Design

19 Information Management NTU An Architecture for Event Notification Source: G. Coulouris et al., Distributed Systems: Concepts and Design subscriberobserverobject of interest Event service object of interest observer subscriber 3. 1. 2. notification

20 Information Management NTU The Roles for Observers/Agents Forwarding Filtering Patterns of Events Notification Mailboxes

21 Information Management NTU Java Remote Interfaces Source: G. Coulouris et al., Distributed Systems: Concepts and Design

22 Information Management NTU Parameter Passing in Java By reference (passed as remote object references)  For parameters whose type is defined as a remote interface, one that extends Remote By value  For parameters of serializable types, including primitive types and classes that implement the serializable interface

23 Information Management NTU A Java Server Source: G. Coulouris et al., Distributed Systems: Concepts and Design

24 Information Management NTU A Java Server (cont.) Source: G. Coulouris et al., Distributed Systems: Concepts and Design

25 Information Management NTU A Java Client Source: G. Coulouris et al., Distributed Systems: Concepts and Design

26 Information Management NTU CORBA Defined by OMG to facilitate the development of distributed object-oriented systems. Language-independency is achieved through the use of a standard interface definition language---the CORBA IDL. 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.

27 Information Management NTU The CORBA Architecture Source of the figure: G. Coulouris et al., Distributed Systems: Concepts and Design * The implementation repository allows server objects to be activated on demand. ** The interface repository gives run-time type information, mainly for dynamic invocations. ***

28 Information Management NTU The Object Adapter Creates remote object references for CORBA objects Maps the names of CORBA objects to their servants Dispatches each remote invocation via a skeleton to the appropriate server object Activate objects

29 Information Management NTU 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.

30 Information Management NTU 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.

31 Information Management NTU Shape and Shapelist in CORBA IDL Source: G. Coulouris et al., Distributed Systems: Concepts and Design

32 Information Management NTU Java Interface Generated from ShapeList Source: G. Coulouris et al., Distributed Systems: Concepts and Design

33 Information Management NTU Java Implementation of Shapelist Source: G. Coulouris et al., Distributed Systems: Concepts and Design

34 Information Management NTU Java Implementation of ShapeList (cont.) Source: G. Coulouris et al., Distributed Systems: Concepts and Design

35 Information Management NTU Java Implementation of a ShapeList Client Source: G. Coulouris et al., Distributed Systems: Concepts and Design

36 Information Management NTU CORBA Services Naming Service  locate objects by their names Trading Service  locate objects by their attributes Event Service and Notification Service Security Service Transaction Service Persistent Object Service

37 Information Management NTU The CORBA Naming Service Allows (1) a name to be bound to an object and (2) that object to be found subsequently by resolving that name. A name is a sequence of name components and is resolved within a given naming context. The IDL interface NamingContext defines the core of the naming service. A NamingContext object acts much like a directory in a filing system.

38 Information Management NTU CORBA Naming Graph initial naming context ShapeList C DE B initial naming context P R S T V Q U XX Source: G. Coulouris et al., Distributed Systems: Concepts and Design

39 Information Management NTU The NamingContext Interface (partial) struct NameComponent { string id; string kind; }; typedef sequence Name; interface NamingContext { void bind (in Name n, in Object obj); binds the given name and remote object reference in my context. void unbind (in Name n); removes an existing binding with the given name. void bind_new_context(in Name n); creates a new naming context and binds it to a given name in my context. Object resolve (in Name n); looks up the name in my context and returns its remote object reference. void list (in unsigned long how_many, out BindingList bl, out BindingIterator bi); returns the names in the bindings in my context. }; Source: G. Coulouris et al., Distributed Systems: Concepts and Design

40 Information Management NTU COM/DCOM COM stands for Component Object Model. Its distributed version is referred to as DCOM. It is a programming model for binary components reuse and a foundation of OLE (Object Linking and Embedding) and ActiveX controls. COM interfaces are defined in the interface definition language IDL and compiled by MIDL.EXE.

41 Information Management NTU COM Objects All COM objects implement the IUnknown interface (defined in unknwn.idl ) or one of its extended interfaces. Methods of IUnknown :  QueryInterface: checks if the named interface is supported and, if so, returns the corresponding interface reference  AddRef  Release A COM object may implement multiple interfaces.

42 Information Management NTU GUIDS To eliminate name collisions, all COM interfaces are assigned a unique binary name at design time that is the physical name of the interface. These physical names are called Globally Unique Identifiers (GUIDs). GUIDs are 128-bit extremely large numbers that are guaranteed to be unique in both time and space.


Download ppt "Information Management NTU Interprocess Communication and Middleware."

Similar presentations


Ads by Google