Using RMI–IIOP in the Development of Distributed Applications Dr. P.G.Sarang, President & ABCOM Information Systems Private. Limited.,

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

CS Network Programming CS 3331 Fall CS 3331 Outline Socket programming Remote method invocation (RMI)
3rd Annual Plex/2E Worldwide Users Conference 13A Batch Processing in 2E Jeffrey A. Welsh, STAR BASE Consulting, Inc. September 20, 2007.
1
Distributed Systems Architectures
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
1 Hyades Command Routing Message flow and data translation.
David Burdett May 11, 2004 Package Binding for WS CDL.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination. Introduction to the Business.
Communicating in J2EE.
21 Copyright © 2005, Oracle. All rights reserved. Oracle Application Server 10g Transaction Support.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Auto-scaling Axis2 Web Services on Amazon EC2 By Afkham Azeez.
Break Time Remaining 10:00.
PP Test Review Sections 6-1 to 6-6
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Operating Systems Operating Systems - Winter 2011 Dr. Melanie Rieback Design and Implementation.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Sample Service Screenshots Enterprise Cloud Service 11.3.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
User Defined Functions Lesson 1 CS1313 Fall User Defined Functions 1 Outline 1.User Defined Functions 1 Outline 2.Standard Library Not Enough #1.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
1 Java Remote Method Invocation java.rmi.* java.rmi.registry.* java.rmi.server.*
1 Distributed Systems Distributed Objects & Remote Invocation CORBA Dr. Sunny Jeong. Mr. Colin Zhang With Thanks.
DISTRIBUTED FILE SYSTEM USING RMI
1 HANDOUT 14 Remote Method Invocation (RMI) BY GEORGE KOUTSOGIANNAKIS THIS DOCUMENT CAN NOT BE REPRODUCED OR DISTRIBUTED WITHOUT TH E WRITTEN PERMISSION.
A First Java ORB Application 1  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces  Interface Definition.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set.
+ A Short Java RMI Tutorial Usman Saleem
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
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.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Java RMI CS-328 Internet Programming.
Presentation transcript:

Using RMI–IIOP in the Development of Distributed Applications Dr. P.G.Sarang, President & ABCOM Information Systems Private. Limited., Mumbai, India Ms Nita P. Sarang, CMC Limited, Mumbai, India

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 2 RMI Remote Method Invocation Suns programming model for distributed objects Java-based

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 3 RMI – merits/demerits Advantages –Ease of programming –No complicated Interface Definition Language (IDL) to learn Disadvantages –Uses Proprietary Protocol Java Remote Method Protocol (JRMP) –No cross-language support

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 4 IIOP Internet Inter-Operable Protocol OMGs programming model for distributed objects Language neutral

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 5 IIOP – merits/demerits Advantages –Interoperability Between different ORB vendors Between different languages Disadvantages –Need to learn Interface Definition Language (IDL) –Complex Programming

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 6 RMI/IIOP Suitability A pure RMI Java solution is suitable for new developments For legacy applications, a CORBA wrapper is required for protecting existing investments

How do we achieve best of both worlds? RMI-IIOP Marriage

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 8 Proposal A new protocol will confuse the user RMI-IIOP Merger should protect investment in existing binaries Reverse Mappings of RMI Interfaces to CORBA IDL OMG is required to support Object by Value (OBV)

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 9 Requirements Existing RMI Clients and Servers both need upgrade to support IIOP

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 10 RMI-IIOP Scenario RMI-IIOP Client CORBA Client CORBA Server IIOP

How do we convert RMI Application to RMI-IIOP Application?

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 12 Converting RMI to RMI-IIOP Use PortableRemoteObject class instead of UnicastRemoteObject Use Java Naming & Directory Interface (JNDI) instead of RMIRegistry Use narrow method instead of Java Casts

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 13 Tools New rmic compiler –Converts Java Interfaces to IDL –Generates IIOP Stubs and tie classes New idlj compiler –Maps IDL to Java –Generates IIOP Stubs and tie classes

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 14 Migration 1. Converting existing RMI applications to RMI-IIOP applications. 2. Using Java-IDL to develop RMI-IIOP applications 3. Converting existing RMI Interfaces to CORBA IDL

Migration – Case 1 Existing RMI to RMI-IIOP

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 16 RMI to RMI-IIOP IIOP RMI Java Client RMI Java Server tie class rmic -iiop Complier stub class RMI Implementation

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 17 RMI to RMI-IIOP 1. Converting Server Extend your implementation class from PortableRemoteObject rather than UnicastRemoteObject: Use JNDI naming service rather than rmiregistry. 2. Converting Client Use JNDI naming service to locate object Use PortableRemoteObject.narrow() method rather than Java type cast.

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 18 Converting Server - Step 1 Use PortableRemoteObject rather than UnicastRemoteObject import javax.rmi.PortableRemoteObject; … public class ComputeImpl extends PortableRemoteObject implements Compute { … }

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 19 Converting Server - Step 2 Use JNDI import javax.naming.*; … Replace Naming.rebind("//localhost/ComputeServer", obj); with java.util.Properties env = System.getProperties(); env.put ("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory"); env.put ("java.naming.provider.url", "iiop://localhost:900"); Context ic = new InitialContext(env); ic.rebind ("//localhost/ComputeServer", obj);

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 20 Converting Client - Step 1 Use JNDI Replace Object obj = Naming.lookup ("ComputeServer"); With java.util.Properties env = System.getProperties(); env.put ("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory"); env.put ("java.naming.provider.url", "iiop://localhost:900"); Context ic = new InitialContext(env); Object obj = ic.lookup ("//localhost/ComputeServer");

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 21 Converting Client - Step 2 Replace java typecast with a call to narrow method Replace Compute TaxObj = (Compute)obj; With Compute TaxObj = (Compute)PortableRemoteObject.narrow (obj, Compute.class);

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 22 Compiling Compile Java Source Files javac –d. *.java Generate Stub and Tie Classes rmic –iiop Example: rmic –iiop –d. com.abcom.tax.ComputeImpl

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 23 Running – Step 1 Use JNDI Name Server rather than rmiregistry Start the JNDI Name Server with following command start tnameserv (on Windows) tnameserv & (on unix)

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 24 Running – Step 2 Start the Server java Example: java com.abcom.tax.ComputeImpl Start the client Java Example: java Client

Migration – Case 2 IDL to RMI-IIOP

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 26 Steps Write Java IDL Use idlj compiler –Generates Java Mappings –Generates stubs and skeletons Implement Server Run Server and register with JNDI service Develop Client and test

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 27 Example Sample Java IDL module abcom{ interface tax { float CalculateTax(in float Amount); }; idlj –fall sample.idl

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 28 Generated Files Compiler generates following files in abcom Java package –_taxImplBase.java –_taxStub.java –tax.java –taxHelper.java –taxHolder.java –taxOperations.java

Migration – Case 3 Existing Java Interfaces to IDL

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 30 RMI to IDL Use rmic to produce idl rmic –idl Map the generated idl to the desired language and provide implementation.

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 31 RMI to IDL RMI Interface Impl. class rmic -idl IDL IDL to C++ C++ CORBA Server rmic -iiop RMI-IIOP Client IIOP

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 32 Sample Java Remote Interface Sample Java Remote Interface package com.abcom.tax; import java.rmi.Remote; import java.rmi.RemoteException; public interface Compute extends Remote { float SalesTax (float Amount) throws RemoteException; }

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 33 Generated IDL #include "orb.idl" … module com { module abcom { module tax { interface Compute { float SalesTax(in float arg0 ); }; … };

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 34 Limitations RMI supports passing objects by value in both parameters and method return types CORBA 2.3 specification now supports Object by Value (OBV) CORBA inout, out parameters not supported

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 35 OBV – Parameter Objects Example public class Server extends PortableRemoteObject implements Compute { … public void printInvoice(Invoice inv)throws RemoteException { … } rmic –idl Server

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 36 Parameter Objects – Generated Files Following IDL files are generated –Compute.idl –Invoice.idl

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 37 Parameter Objects – Compute.idl valuetype Invoice; … interface Compute { void printInvoice(in ::Invoice arg0 ); };

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 38 Parameter Objects – Invoice.idl valuetype Invoice { private long quantity; private long totalAmt; private ::CORBA::WStringValue itemDesc; factory create( ); };

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 39 OBV – Returning objects Example public class Server extends PortableRemoteObject implements Compute { … public Invoice computeInvoice()throws RemoteException { … } rmic –idl Server

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 40 Return Objects – Generated Files Following IDL files are generated. –Compute.idl –Invoice.idl

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 41 Return Objects – Compute.idl valuetype Invoice; … interface Compute { … ::Invoice computeInvoice( ); }; Invoice.idl is same as in previous case

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 42 OBV – Dynamic Downloading Remote classes for parameter objects can be dynamically downloaded using RMI class loading mechanism –Requires setting of java.rmi.server.codebase environment variable

O'Reilly Conference on Java - Enterprise Java Using RMI-IIOP in the Development of Distributed Applications 43 Support for Objects by Value Supported in CORBA 2.3 specification Initial support by Java IDL ORB Support now added by Major ORB vendors Support defined for Java and C++

Conclusions

Thank You