Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.

Similar presentations


Presentation on theme: "Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy."— Presentation transcript:

1 Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5
B.Ramamurthy 2/17/2019 B.Ramamurthy

2 Figure 5.1 Middleware layers
Applications This chapter Remote invocation, indirect communication (and Chapter 6) Middleware Underlying interprocess communication primitives: layers Sockets, message passing, multicast support, overlay networks UDP and TCP Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn © Pearson Education 2012

3 Figure 5.10 Role of client and server stub procedures in RPC
Request Reply Communication module dispatcher service client stub server stub procedure client process server process program Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn © Pearson Education 2012

4 Remote Method Invocation
Remote Method Invocation (RMI) is Java’s implementation of object-to-object communication among Java objects to realize a distributed computing model. RMI allows us to distribute our objects on various machines, and invoke methods on the objects located on remote sites. 2/17/2019 B.Ramamurthy

5 RMI-based Distributed System
4. XYZ Implementation Client Host Server Host Client Stub interface uses implements 1. 2. 3. 5. 2/17/2019 B.Ramamurthy

6 Steps in RMI-based Application
1. Design the interface for the service. 2. Implement the methods specified in the interface. 3. Generate the stub and the skeleton. 4. Register the service by name and location. 5. Use the service in an application. 2/17/2019 B.Ramamurthy

7 Compile and Register Commands
rmiregistry Finds object by name Stores object by name rmic 5. 3. 3. 2. XYZ Client Skeleton XYZ Implementation Stub 1. uses implements XYZ interface Client Host Server Host 2/17/2019 B.Ramamurthy

8 More Details Once the object (or service) is registered, a client can look up that service. A client (application) receives a reference that allows the client to use the service (call the method). Syntax of calling is identical to a call to a method of another object in the same program. 2/17/2019 B.Ramamurthy

9 Parameter Marshalling
Transfer of parameters (or marshalling) is done by the RMI. Complex objects are streamed using Serialization. Byte-fication of an object. Implementation: Any object that allows serialization inherits Serlizable interface Serialization is an example of Marker interface 2/17/2019 B.Ramamurthy

10 Oracle Java RMI docs 2/17/2019 B.Ramamurthy

11 Streaming URLs Using the openStream of java.net.URL class you can stream in the file spefied by an universal resource locator(url). It can be streamed into a buffer where it can be analyzed for information. Any number of urls can be streamed in. Unicast Communication : When you are interested in a particular remote site you will direct your net connection to that particular site using unicast. 2/17/2019 B.Ramamurthy

12 Web Services (Colouris)
A web service provides a service interface enabling clients to interact with servers in a more general way than web browsers do. Clients access operations in the interface usually by XML messages over http. Or other architectural models such as REST and SOAP could access WS. WSDL provides additional details than for standard operation: for encoding, security, communication and location.

13 REST vs SOAP (midterm question?)
Both are architectural styles and framework for creating web services in a client/server based distributed system. SOAP is application-specific and exposes its own set of operations for distributed application. REST on the other hand uses predefined set of standard operation for manipulating resources in a distributed systems. 2/17/2019 B.Ramamurthy

14 REST Roy Fielding’s dissertation: Apache Software Foundation co-founder. Computer interact using standard operations on https: GET, POST, PUT, DELETE; You also provide the resource identifier to operate on. Payload can be formatted in HTML, XML or JSON, etc. B.Ramamurthy

15 REST Principles Client/server architecture Stateless Cacheable
Layered system (intermediate server with specific functionality.. C/S may not be directly connected) Uniform interface 2/17/2019 B.Ramamurthy

16 Services, ports and bindings
Service endpoint interface (SEI) or service endpoint that defines one or more operations that the web service offers. Access to an endpoint is provided by binding it to a protocol stack through a port. A port has an address that the client can use to communicate with the service and invoke its operations. An endpoint can be bound to different ports each offering a different suite of protocols for interaction.

17 Endpoint, Port and binding
Web service endpoint Port port port3 Web services Client SOAP1.1 Over http SOAP 1.1 over https Other. Ex: ebXML over SMTP https 1.x transport soap1.1 messages

18 Summary We discussed designing a distributed system using RMI
We also looked at RMI internal We also learned about marker interface, distributed garbage collection, object marshalling, registry, server-port binding, 2/17/2019 B.Ramamurthy


Download ppt "Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy."

Similar presentations


Ads by Google