Presentation 24 Ultra Simple.NET Remoting to CORBA bridge.

Slides:



Advertisements
Similar presentations
Slide 1 Objektorienteret Middleware (OOMI) CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application.
Advertisements

.Net Remoting Pooja Panjala 06/17/10. Agenda What is.net Remoting? Explanation of terms Architecture Implementation of Remoting Sample example.net Security.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
C# and Windows Programming Application Domains and Remoting.
Author: Bill Buchanan. Authentication (to identify the clients of your application) Authorization (to provide access controls for those clients) Secure.
1 Distributed Systems Distributed Objects & Remote Invocation CORBA Dr. Sunny Jeong. Mr. Colin Zhang With Thanks.
1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels.
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.
DISTRIBUTED FILE SYSTEM USING RMI
A brief look at CORBA. What is CORBA Common Object Request Broker Architecture developed by OMG Combine benefits of OO and distributed computing Distributed.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
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)
A First Java ORB Application 1  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces  Interface Definition.
By Dr. Jiang B. Liu 11. Java IDL and CORBA  Generic ORB Core  idltojava development tool  CORBA Object Service (COS) name service - nameserv  Java.
Task Bag A Distributed System using the.NET Framework and Remoting Frank McCown Old Dominion University Spring 2005 CS 875 Distributed Systems - Final.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
1 Java Programming II Java Network II (Distributed Objects in Java)
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Presentation: SOAP in a distributed object framework, Application Servers & AXIS SOAP.
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Slide 1 CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application ITONK1.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
In the name of Allah The Proxy Pattern Elham moazzen.
Presentation 23.NET Remoting Introduced. Ingeniørhøjskolen i Århus Slide 2 af 20 Outline.NET Framework introduced.NET Remoting strategies Architecture.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
Objekt orienteret Netværkskommunikation CORBA Introduction & CORBA Programming.
Abhishek Bachchan Vishal Patangia
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
RMI-IIOP.  RMI-IIOP combines RMI-style ease of use with CORBA cross-language interoperability  Java™ Remote Method Invocation (RMI) provides a simple.
MSc Course in Advanced Distributed Systems Session 2.2: Practical CORBA Programming
Systems Prog. & Script. - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 11: The Distributed Object Model.
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.
Slide 1 Objektorienteret Netværkskommunikation CORBA Introduction.
Objektorienteret Middleware (OOMI)
Presentation 23:.NET Remoting Introduced Objektorienteret Middleware.
Presentation 11: RMI introduction. Ingeniørhøjskolen i Århus Slide 2 af 20 Goals of this lesson After these 2x35 lessons you will be –Introduced to Java.
Remote Method Invocation with Java-RMI
Objektorienteret Netværkskommunikation (ITONK1) CORBA Introduction.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Presentation: Advanced AXIS: Deployment Descriptors and Advanced Types.
Slide 1 of 15 © Ingeniørhøjskolen i Århus CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application.
Presentation: Special Repetition Recap on Distributed Principles.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Distributed Computing in Life Science Research -Presenter: Yijian Yang
IDL Models The Inheritance Model: Using the Inheritance Model, you implement the IDL interface using an implementation class that also extends the compiler-generated.
1 Nordjyllands Erhvervakademi Net Remoting Architecture Marshalling –Marshalling By Reference(MBR) –Marshalling By Value(MBV) Activation by MBR.
Netprog Java RMI1 Remote Method Invocation.
Topic 5: CORBA RMI Dr. Ayman Srour
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
.NET Remoting. Remoting Introduction The process of programs or components interacting across certain boundaries either different processes or machines.
CORBA & Design Pattern Csc8350 Advanced Software Engineering Georgia State University Dr. Xiaolin Hu.
Only small steps in CORBA programming – much complexity
Outline SOAP and Web Services in relation to Distributed Objects
Broker in practice: Middleware
Presentation 23 .NET Remoting Introduced
Advanced .NET Programming II 10th Lecture
Outline SOAP and Web Services in relation to Distributed Objects
Remote Method Invocation
Programming Models for Distributed Application
Remote Procedure Call (invocation) RPC
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Copyright © 2001 Qusay H. Mahmoud
Presentation transcript:

Presentation 24 Ultra Simple.NET Remoting to CORBA bridge

Ingeniørhøjskolen i Århus Slide 2 af 8 Outline This very simple sample will exemplify how to make a simple HelloWorld.NET Remoting server bridge to CORBA A real bridge will most often be generic, and translate on-the-fly with reflection mechanism’s using e.g. the Dynamic Invocation Interface Such bridges might be supplied by the vendor Here we will only make a “static” bridge

Ingeniørhøjskolen i Århus Slide 3 af 8 Making the HelloWorld application Using Microsoft Visual Studio.NET Only Remoting Client and Server Make the CORBA server yourself (or use Middcors “Hello” tutorial, which will fit perfectly for this) Server: –IHelloWorld.cs interface –HelloWorld.cs class implementation We place the bridging code in the sayHello method-call –Use Hello.idl to generate Hello.cs (Hello namespace) –Server.cs class implementation for boot-strapping –Add Reference to assembly System.Runtime.Remoting Add Reference to MiddCor.dll (for CORBA) Client (same as pure.NET Remoting example) –Must add IHelloWorld.cs –Client.cs class implementation –Add Reference to assembly System.Runtime.Remoting

Ingeniørhøjskolen i Århus Slide 4 af 8 The IHelloWorld interface using System; namespace RemotingHelloServer { // IHelloWorld is the interface for the HelloWorld server class. // It is the interface that is shared across the Internet public interface IHelloWorld { string sayHello(string name); } using System; namespace RemotingHelloServer { // IHelloWorld is the interface for the HelloWorld server class. // It is the interface that is shared across the Internet public interface IHelloWorld { string sayHello(string name); } The “IDL” of.NET Remoting – used between the Remoting server and client NOTHING NEW – same as Remoting example

Ingeniørhøjskolen i Århus Slide 5 af 8 Server code – Console bootstrapping using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace RemotingHelloServer { public class Server { [STAThread] static void Main(string[] args) { //Create a TCP channel TcpChannel theChannel = new TcpChannel(8085) /* Register the channel so that clients can * connect to the server */ ChannelServices.RegisterChannel(theChannel); //Register the service on the channel RemotingConfiguration.ApplicationName = "HelloWorld App"; RemotingConfiguration.RegisterWellKnownServiceType( typeof(HelloWorld), "HelloWorld App", WellKnownObjectMode.SingleCall); /*Start the server and keep it running so that clients * can connect to it. May be aborted by keypress */ System.Console.WriteLine("Press Enter to end this server process"); System.Console.Read(); } } } using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace RemotingHelloServer { public class Server { [STAThread] static void Main(string[] args) { //Create a TCP channel TcpChannel theChannel = new TcpChannel(8085) /* Register the channel so that clients can * connect to the server */ ChannelServices.RegisterChannel(theChannel); //Register the service on the channel RemotingConfiguration.ApplicationName = "HelloWorld App"; RemotingConfiguration.RegisterWellKnownServiceType( typeof(HelloWorld), "HelloWorld App", WellKnownObjectMode.SingleCall); /*Start the server and keep it running so that clients * can connect to it. May be aborted by keypress */ System.Console.WriteLine("Press Enter to end this server process"); System.Console.Read(); } } } Register the channel on port 8085 Register the channel on port 8085 Register the object Register the object Like in Java RMI (& CORBA) – we need some bootstrapping code – a server process This may become a Windows NT service or a simple application, e.g. a console or Windows Form application NOTHING NEW – same as Remoting example

Ingeniørhøjskolen i Århus Slide 6 af 8 Client code – Console bootstrapping … include all the Remoting stuff namespace RemotingHelloClient { public class Client { [STAThread] static void Main(string[] args) { TcpChannel theChannel = new TcpChannel(); ChannelServices.RegisterChannel(theChannel); /* Activate the server object. Activation will bring * the server object to life, and create a proxy * stub class of the HelloWorld. In fact, as this is a * server-activated application, the call to the * server is NOT performed now, but instead waits until the * first request. It is thus the server who performs the * activation. This is the "Lazy-activation pattern" known * from e.g. CORBA */ IHelloWorld helloWorld = (IHelloWorld) Activator.GetObject( typeof(RemotingHelloServer.IHelloWorld), "tcp://localhost:8085/HelloWorld App"); System.Console.WriteLine("Please enter your name and press Enter"); string name = System.Console.ReadLine(); //Make the call string greeting = helloWorld.sayHello(name); System.Console.WriteLine("We recieved from server: "+greeting); System.Console.WriteLine("Press Enter to end"); System.Console.Read(); } … include all the Remoting stuff namespace RemotingHelloClient { public class Client { [STAThread] static void Main(string[] args) { TcpChannel theChannel = new TcpChannel(); ChannelServices.RegisterChannel(theChannel); /* Activate the server object. Activation will bring * the server object to life, and create a proxy * stub class of the HelloWorld. In fact, as this is a * server-activated application, the call to the * server is NOT performed now, but instead waits until the * first request. It is thus the server who performs the * activation. This is the "Lazy-activation pattern" known * from e.g. CORBA */ IHelloWorld helloWorld = (IHelloWorld) Activator.GetObject( typeof(RemotingHelloServer.IHelloWorld), "tcp://localhost:8085/HelloWorld App"); System.Console.WriteLine("Please enter your name and press Enter"); string name = System.Console.ReadLine(); //Make the call string greeting = helloWorld.sayHello(name); System.Console.WriteLine("We recieved from server: "+greeting); System.Console.WriteLine("Press Enter to end"); System.Console.Read(); } Create Proxy Call via Proxy object Optional (may be done implicitly) NOTHING NEW – same as Remoting example

Ingeniørhøjskolen i Århus Slide 7 af 8 HelloWorld Implementation code using System; using System.Runtime.Remoting; using Middsol; using Hello; namespace RemotingHelloServer { // HelloWorld is a server object that is available // "by-reference". It contains a constructor and a the // "sayHello" method taking a string parameter "name" public class HelloWorld : MarshalByRefObject, IHelloWorld { public string sayHello(string name) { Middsol.CORBA.ORB oOrb = Middsol.CORBA._ORB.init( null, null); // Get CORBA Object via IOR Middsol.CORBA.Object obj = oOrb.string_to_object( "file://c:\\hello.ior" ); // Narrow CORBA Object the Greetings Interface Hello.Greetings oGreetings = Hello.GreetingsHelper.narrow( obj ); // Call hello-Operation return (oGreetings.hello( name )); } using System; using System.Runtime.Remoting; using Middsol; using Hello; namespace RemotingHelloServer { // HelloWorld is a server object that is available // "by-reference". It contains a constructor and a the // "sayHello" method taking a string parameter "name" public class HelloWorld : MarshalByRefObject, IHelloWorld { public string sayHello(string name) { Middsol.CORBA.ORB oOrb = Middsol.CORBA._ORB.init( null, null); // Get CORBA Object via IOR Middsol.CORBA.Object obj = oOrb.string_to_object( "file://c:\\hello.ior" ); // Narrow CORBA Object the Greetings Interface Hello.Greetings oGreetings = Hello.GreetingsHelper.narrow( obj ); // Call hello-Operation return (oGreetings.hello( name )); } Like in Java RMI (& CORBA) – we need to have an implementation of the interface A remote object “by-reference” that implements the IHelloWorld interface A remote object “by-reference” that implements the IHelloWorld interface Implementing the sayHello method Static CORBA client stuff Static CORBA client stuff Use Remoting, ORB and generated Proxy stub (Hello) Use Remoting, ORB and generated Proxy stub (Hello) FINALLY NEW – the sayHello method has changed to become a CORBA client

Ingeniørhøjskolen i Århus Slide 8 af 8 The Hello.idl CORBA IDL module Hello { interface Greetings { string hello( in string a_strName); }; module Hello { interface Greetings { string hello( in string a_strName); }; For MiddCor ORB proxy stub compilation: MCidl2cs.exe Hello.idl ALSO NEW – the IDL needed for proxy stub generation (and the server)