1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
SOAP.
RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
.Net Remoting Pooja Panjala 06/17/10. Agenda What is.net Remoting? Explanation of terms Architecture Implementation of Remoting Sample example.net Security.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
C# and Windows Programming Application Domains and Remoting.
.NET REMOTING CertSIG Tom Perkins. FUNDAMENTALS Distributed Applications Process A Process B Process C Objects can communicate across process boundaries.
Author: Bill Buchanan. Authentication (to identify the clients of your application) Authorization (to provide access controls for those clients) Secure.
.NET Remoting. .Net Remoting Replaces DCOM (Distributed Component Object Model – a proprietary Microsoft technology for communication among software components.
Remote Method Invocation
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
Remote Object Invocation
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
1 HANDOUT 14 Remote Method Invocation (RMI) BY GEORGE KOUTSOGIANNAKIS THIS DOCUMENT CAN NOT BE REPRODUCED OR DISTRIBUTED WITHOUT TH E WRITTEN PERMISSION.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Distributed Systems Tutorial 2 -.NET Remoting. 2 What is Remoting?  Remoting allows you to pass objects or values across servers in different domains.
Introduction to Remote Method Invocation (RMI)
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
.NET Remoting Architecture. Slide 2 CITE 4420.NET Remoting Topics Remoting Boundaries Crossing the Boundaries Distributed Applications Marshalling Channels.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set.
1 G52IWS: Distributed Computing Chris Greenhalgh.
Distributed Communication via ASP.Net Web Services and.Net Remoting By Richard King.
Lecture 15 Introduction to Web Services Web Service Applications.
Comparison of Web Services, RMI, CORBA, DCOM Usha, Lecturer MCA Department of Computer Science and Engineering.
1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. With Thanks to.
Information Management NTU Interprocess Communication and Middleware.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Abhishek Bachchan Vishal Patangia
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
Distributed Programming CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Java Remote Method Invocation RMI. Idea If objects communicate with each other on one JVM why not do the same on several JVM’s? If objects communicate.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
CORBA Common Object Request Broker Architecture. Basic Architecture A distributed objects architecture. Logically, an object client makes method calls.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
Presented By:- Sudipta Dhara Roll Table of Content Table of Content 1.Introduction 2.How it evolved 3.Need of Middleware 4.Middleware Basic 5.Categories.
Common Object Request Broker Architecture (CORBA) The Common Object Request Broker Architecture (CORBA) is a specification of a standard architecture for.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Kemal Baykal Rasim Ismayilov
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Remote Method Invocation A Client Server Approach.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Distributed Computing in Life Science Research -Presenter: Yijian Yang
1 Nordjyllands Erhvervakademi Net Remoting Architecture Marshalling –Marshalling By Reference(MBR) –Marshalling By Value(MBV) Activation by MBR.
Topic 5: CORBA RMI Dr. Ayman Srour
.NET Remoting. Remoting Introduction The process of programs or components interacting across certain boundaries either different processes or machines.
Broker in practice: Middleware
Remote Method Invocation
CORBA Alegria Baquero.
Presentation 23 .NET Remoting Introduced
Advanced .NET Programming II 10th Lecture
What is RMI? Remote Method Invocation
Remote Method Invocation
Knowledge Byte In this section, you will learn about:
CORBA Alegria Baquero.
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
WebServices Using JAX-RPC
Java Remote Method Invocation
Software Engineering and Architecture
Presentation transcript:

1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels

2 Background  Networking computers share resources and data amongst them in a cohesive manner  Today various computer applications use distributed computing in one form or the other  File servers, web application servers, print servers  Nowadays, the processing power of computers is sufficiently advanced and their use became widespread  So, why not harness the power of many personal computers in tandem and using them to process data?

3 Background  To harness the computational computer power of several computers, some distributed technologies came into light  Common Object Request Broker Architecture CORBA: by Object Management Group (OMG)  Remote Method Invocation (RMI): by Sun Microsystems  Distributed Component Object Mode ( DCOM): by Microsoft  Web services: invented by IBM Global Services

4 Background CORBARMIDCOM Object Implementation Diverse languages can be used as long as the IDL can be mapped to that language. Only Java language can be applied, because the Java Object Serialization usage. Specification is at the binary level. Diverse languages like C++, Java, Delphi, and even COBOL can be used. Client/Server Interface The client stub is called a stub, and the server side is skeleton. The client stub is called a proxy, and the server side is called stub. Object Location and Activation The ORB is used to locate an object, and Object Adapter is used for activation. The object location and activation are on Java Virtual Machine (JVM) Use the Service Control Manager (SCM) to locate and activate an object. On-demand Activation A client can bind to a naming or a trader service to activate a server object by obtaining a server reference. A client can do a lookup() on the remote server object’s URL name to obtain the object reference. A client can do a CoCreateInstance() to activate a server object.

5 DCOM versus Web Services  Both DCOM and Web Services are used to achieve distributed application development  In DCOM  the object will be created both on the client and server side  The client side object is called as Proxy and the server side object is called as Stub  Once these two are created the proxy and stub interact with each other in sending and receiving the data remotely

6 DCOM versus Web Services  In Web Services  the object will be created only on the client side  When a method is invoked from the client the proxy creates a request SOAP message and opens the http connection  Then the request SOAP message is sent to the server through the http connection  The Server then receives the request and converts it into the back end object and processes it  The server then creates a response message and sends the response back to the client using the http connection  The proxy receives it and converts into the required object and sends it to the client for further usage

7 Remoting  When developing a distributed application, the underlying framework should provide transparent programming model to the application developer  Proxies play major role in this area  The proxy object acts as a 'dummy' of the remote object and forward all the method calls to the remote object instance  These proxy objects are created at client end  The client is unaware of the actual location of the remote object  The client simply calls the methods on the proxy object which are then forwarded to the actual object

8 Types of Remoting: MBV  There are two ways an object in one application domain can be made available to another application domain  The first option involves serializing the object, transport it to the other domain using streams  The object is then de-serialized and used at the other side  This version is called Marshall by value (MBV)  MBV should be considered only if the object does not depend on any data in its original domain

9 Types of Remoting (MBR)  The second type of remoting is called Marshall by reference (MBR)  In this case, the client communicates with the remotable object through a proxy, but the object remains in its application domain  To the client, the proxy appears as if it is the actual object  However, for each call made to the proxy, the proxy passes the call to the remote object using a communication channel, obtain a result from the remote object and pass same to the client

10 Remoting: Formatters  The communication between the client and remote object involves method parameters and return values  This data must be serialized before it is sent across the network  The serialization process creates a persistent copy of the data as a sequence of bytes  The process of converting these bytes back into the original data structure is called de-serialization  Formatters perform the serialization and de- serialization processes

11 Remoting: Formatters  Formatters are available in following namespaces: System.Runtime.Serialization.Formatters.Binary System.Runtime.Serialization.Formatters.SOAP As the names suggest Binary formatter deals with data in binary format while SOAP formatter deals with data in XML format

12 Remoting: Channels  To communicate with remote object we need a path through which the data transfer can take place  This path is called as Channel. There are two types of channels:  TCP channels : these channels use TCP for communication TCP channels typically carry data in binary form i.e. they use Binary formatters  HTTP Channels : These channels use HTTP for communication. They typically carry SOAP messages i.e. they use SOAP formatters

13 Remoting: Channels  TCP channels with Binary formatters are suitable where speed and performance is important  HTTP Channels with SOAP formatters are suitable for platform independent or over the web communication  The channels are available in following namespaces: System.Runtime.Remoting.Channels.TCP System.Runtime.Remoting.Channels.HTTP

14 How Does Remoting Work?  When the client application communicates with the remote object following steps are involved:  At Server Side  A Channel is established at a specific port which will listen to all client requests  Remote object registers itself with remoting framework and declares its presence over the network  At Client Site  Client establishes a channel at a specific port to talk with remote object  Client creates an instance of remote object by calling Getobject or CreateInstance or new method  Client gets the proxy for the remote object  Client calls remote object methods on the proxy

15 Remoting Server  This is an application that a client connects to in order to gain access to the method of the remotable class  Such an application must do three things as follows:  Create a communication channel: This can be done with either the TcpChannel class of System.Runtime.Remoting.Channels.Tcp namespace, or using the HttpChannel class of System.Runtime.Remoting.Channels.Http namespace  Register the communication channel created with the remoting channel services

16 Remoting Server  This is done by passing the channel to the static method, RegisterChannel, of the ChannelServices class, which is in the System.Runtime.Remoting.Channels namespace  Register the remotable class with the remoting server  This is done by using the static method, RegisterWellKnownServiceType of the RemotingConfiguration class, of the System.Runtime.Remoting namespace  This method takes three arguments: The type of the remotable class A URI identifier for the class, and Object creation mode

17 Remoting Server  Possible modes are: SingleCall and Singleton, both of which are fields of the WellKnownObjectMode class  SingleCall means a separate instance of the remotable class will be created for each call to the remotable class  Singleton mode means, a single instance will be used for different calls for all clients  Singleton is useful if you wish to retain the state across different calls

18 Remoting Client This is the application that is used to access the methods of the remotable class through the remoting server  Here again, there are three things that the client class must do to communicate with the remotable class:  Create a channel. This must be of the same type as that of the remoting server  Register the communication channel created with the remoting channel services  Creating an instance of the proxy class. The proxy class is like an alias to the remotable class, so all calls to the remotable class are made through the proxy class  Here we have two options:  We use the RegisterWellKnownClientType of the RemotingConfiguration class. This takes the type of the remote class and its URI as arguments  Alternatively, we can use the getObject method of the Activator class, which is in the System namespace

19 Example: RemotingServer.cs using System; using System.IO; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels.HTTP; namespace RemotingServer { public class MyServer : MarshalByRefObject { public MyServer() { } public string GetString(string text) { Console.WriteLine(text); return "Hello " + text; } } public class StartServer { public static void Main(string[] s) { HTTPChannel channel = new HTTPChannel(8000); ChannelServices.RegisterChannel(channel); RemotingServices.RegisterWellKnownType ("remotingserver","RemotingServer.MyServer", "ServerClassURI",WellKnownObjectMode.Singleton) ; Console.WriteLine("Press enter to stop server..."); Console.ReadLine(); } } }

20 Example: RemotingClient.cs using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels.HTTP; using RemotingServer; public class RemotingClient { public static void Main(string[] s) { HTTPChannel channel = new HTTPChannel(8001); ChannelServices.RegisterChannel(channel); MyServer server = (MyServer)Activator.GetObject(typeof(MyServer), " Console.WriteLine(server.GetString("Bipin")); } }