240-322 Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA 240-322, Semester 1, 2005-2006 13. RMI and CORBA.

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Common Object Request Broker Architecture (CORBA) By: Sunil Gopinath David Watkins.
Remote Method Invocation
1 Distributed Systems Distributed Objects & Remote Invocation CORBA Dr. Sunny Jeong. Mr. Colin Zhang With Thanks.
The road to reliable, autonomous distributed systems
CORBA - Common Object Request Broker Architecture.
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
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
Advanced Java Class Network Programming. Network Protocols Overview Levels of Abstraction –HTTP protocol: spoken by Web Servers and Web Clients –TCP/IP:
Persistent State Service 1 Performance, Scalability and Management  Topic  Refining the object model  Threading models  Distributed callbacks  Iterators.
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)
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Distributed Service Architectures Yitao Duan 03/19/2002.
Introduction to Remote Method Invocation (RMI)
Performance Management 1 Performance, Scalability and Management  Topic  Refining the object model  Threading models  Distributed callbacks  Iterators.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
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.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
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.
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.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
CORBA IS 8030 – Integrated Computing Environments Dr. Hoganson CORBA Common Object Request Broker Architecture Published by Object Management Group (OMG)
Introduction to CORBA University of Mazandran Science & Tecnology By : Esmaill Khanlarpour January
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.
Silberschatz, Galvin, and Gagne  1999 Applied Operating System Concepts Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote.
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.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
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.
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.
 Common Object Request Broker Architecture  An industry standard developed by OMG to help in distributed programming.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
Topic 5: CORBA RMI Dr. Ayman Srour
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Java Distributed Object System
Common Object Request Broker Architecture (CORBA)
Java Distributed Computing
Broker in practice: Middleware
Remote Method Invocation
Java RMI CS-328 Internet Programming.
What is RMI? Remote Method Invocation
Java Remote Method Invocation
Copyright 1999 B.Ramamurthy
Presentation transcript:

Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA

Cli/Serv.: rmiCORBA/ RMI Overview 1.1What is RMI? 1.2A Typical RMI Application 1.3.Server-side Features 1.4. Client-side Features 1.5.Advantages 1.6.Disadvantages 1.7.More Details on RMI

Cli/Serv.: rmiCORBA/133 v RMI == Remote Method Invocation –allows a Java object to call a method of a Java object running on another machine –RMI is a modern version of RPC for communication between Java objects 1.1. What is RMI ?

Cli/Serv.: rmiCORBA/ A Typical RMI Application rmiregistry client server remote objects lookup remote reference 2 store (rebind) remote references 1 invoke method via the remote stub 4 remote stub

Cli/Serv.: rmiCORBA/ Server-side Features v The server: –creates remote objects (objects that will be accessible by clients) u the server is sometimes called a server factory –places remote references (names) for the objects in the –places remote references (names) for the objects in the rmiregistry u they can then be accessed by clients continued

Cli/Serv.: rmiCORBA/136 v A remote object is made from a remote interface and a separate implementation class. v A remote interface is a set of method prototypes –a method prototype is the name of the method and the types of its input arguments and return type continued remote interface impl.

Cli/Serv.: rmiCORBA/137 Example Remote Interface import java.rmi.Remote; import java.rmi.RemoteException; public interface Hello extends Remote { String sayHello() throws RemoteException; } The remote object will have this interface

Cli/Serv.: rmiCORBA/ Client-side Features  The client gets a reference to a server's remote object by querying the rmiregistry. v At the programming level, this reference appears to be the remote object –in fact it refers to a remote stub which is downloaded invisibly from the rmiregistry

Cli/Serv.: rmiCORBA/139 v The remote stub is an ordinary Java class –its purpose is to handle the low-level communication between the client and the remote object on the server-side. v Object data is passed between the client and server using a standard feature of Java called object serialization.

Cli/Serv.: rmiCORBA/1310 Diagram of Communication client remote object hi.sayHello() is really... remote stub 1. serialize the call 2. stream of bytes server 3. call 4. result 5. stream of bytes 6. result

Cli/Serv.: rmiCORBA/ Advantages v Dynamic code loading –a client does not need to contain any communication code when written -- that is downloaded when the remote stub is retrieved –a client can dynamically download other classes u e.g. those used by the remote stub –the server can also download code from the client continued

Cli/Serv.: rmiCORBA/1312 v The programmer doesn't write any communication code –the remote stub is generated automatically by passing the remote interface to the RMI compiler ( rmic )

Cli/Serv.: rmiCORBA/ Disadvantages v Not easy to integrate RMI Java code with legacy applications in other languages (e.g. C, C++).

Cli/Serv.: rmiCORBA/ More Details on RMI v The Java RMI tutorial v A starting point for RMI information:

Cli/Serv.: rmiCORBA/ CORBA Overview 2.1. What is CORBA? 2.2. Important CORBA Features 2.3. Why use CORBA? 2.4. CORBA/Java Advantages 2.5. A CORBA Application 2.6. Other CORBA Coding Styles 2.7. Comparisons with Other Approaches 2.8. More Details on CORBA

Cli/Serv.: rmiCORBA/ What is CORBA? v The Common Object Request Broker Architecture (CORBA) –a specification, not an implementation v The Object Management Group’s (OMG) aim: –specify a distributed computing environment within an object-oriented framework u i.e. using objects, methods, message passing, etc.

Cli/Serv.: rmiCORBA/1317 Using CORBA (simple view) Client object ORB call a method in an object managed by the server by using an object reference network Server ORB method call & result objects managed by the server

Cli/Serv.: rmiCORBA/1318 ORBs v An Object Request Broker (ORB) implements the features specified by CORBA. v An ORB can be coded in any language –so long as it supports CORBA’s functionality v ORBs communicate using the Internet Inter- ORB Protocol (IIOP) –an extension of TCP

Cli/Serv.: rmiCORBA/1319 Major ORB Components Dynamic Invocation IDL Stubs ORB Interface IDL Skeleton Object Adapter ORB Core ClientObject Implementation

Cli/Serv.: rmiCORBA/1320 Using CORBA (more detail) Client IDL client stub ORB interface ORB internals ORB interface ORB internals Server IDL server skeleton Network

Cli/Serv.: rmiCORBA/1321 v IDL: Interface Definition Language –for defining OO data and methods  The J2SE idltojava compiler generates client stubs and server skeletons for work with any CORBA ORB. v J2SE includes a simple (free) ORB. (Java) IDL

Cli/Serv.: rmiCORBA/1322 IDL Examples module HelloApp { interface Hello { string sayHello(); }; }; continued

Cli/Serv.: rmiCORBA/1323 module Appliance { interface TV { readonly attribute string SerialNo; attribute short Vol; attribute short Channel; void operate(); }; interface WebTV : TV { void surfTo(in URL url); }; };

Cli/Serv.: rmiCORBA/ Important CORBA Features v An object’s interface (service) is completely separated from its implementation. v An object’s location is completely hidden. Consequently, CORBA provides: –a naming service(white pages) –a trading service(yellow pages) –an interface Repository (IR) continued

Cli/Serv.: rmiCORBA/1325 v Object communication is greatly simplified: –messages, written in IDL v An object can find other objects at run-time by using the Dynamic Invocation Interface (DII): –but the usual approach is to already know the location of the other object continued

Cli/Serv.: rmiCORBA/1326 v Objects can be built more easily by using pre-existing CORBA services for: –message encoding, object locating, security, etc. v Advanced services: –persistent objects, transactions, concurrency control, etc. continued

Cli/Serv.: rmiCORBA/1327 v CORBA facilities: –horizontal and vertical application frameworks –e.g. printing, mobile agents v Convert legacy code in Basic, C, etc. into objects –uses CORBA object adaptors

Cli/Serv.: rmiCORBA/ Why Use CORBA? v It provides a powerful OO mechanism for defining the interfaces between distributed objects. v It offers many services and facilities. v Platform/language independent. v An open standard: –ensures its continued innovation and evolution

Cli/Serv.: rmiCORBA/ CORBA/Java Advantages v CORBA’s advantages for Java: –CORBA supports object method calling from anywhere –CORBA allows Java to work with objects coded in other (non-OO) languages –CORBA augments Java’s networking features u e.g. it encourages multi-host applications continued

Cli/Serv.: rmiCORBA/1330 v Java’s advantages for CORBA –Java’s OO features match those in CORBA u e.g. separation of interface (service) and impl. –Java has many useful features for implementing CORBA services and facilities: u multi-threading, exceptions, GUI, packages, automatic garbage collection

Cli/Serv.: rmiCORBA/ A CORBA Application v 1. Write an IDL interface for the remote objects managed by the server. v 2.Compile the IDL interface –it generates a Java version of the interface –it generates stub and skeleton code for the client and server continued

Cli/Serv.: rmiCORBA/1332 v 3. Write the server, which has two parts –the server (factory) u it creates remote objects –the remote object implementation (of the IDL interface) v 4. Implement the client –it contacts and uses a remote object

Cli/Serv.: rmiCORBA/1333 Running the Application tnameserv client server factory remote objects lookup remote reference to an object 2 store (rebind) remote references for objects 1 invoke method via the remote reference and stub 4 ORBORB O R B network 3 remote stub

Cli/Serv.: rmiCORBA/1334 Using a Remote Object Client (object) object ref server object method invocation continued Client object ref server object execution 4

Cli/Serv.: rmiCORBA/1335 Client object ref server object return method result Client object ref server object garbage collect

Cli/Serv.: rmiCORBA/1336 Client Callback Client object ref B method invocation object A Server object B object ref A continued 4

Cli/Serv.: rmiCORBA/1337 Client object ref B method invocation (callback) object A Server object B object ref A

Cli/Serv.: rmiCORBA/ Other CORBA Coding Styles Single-threaded server Multi-threaded server Being a client and a server Blocking vs. one-way Pass by reference vs. pass by value

Cli/Serv.: rmiCORBA/ Single-threaded Server client 1 server client 2 method call result suspended busy method call call proceeds busy suspended result wait

Cli/Serv.: rmiCORBA/ Multi-threaded Server client 1 server client 2 method call result suspended method call suspended result thread exits thread exits

Cli/Serv.: rmiCORBA/1341 Object Factory Pattern client 1 server client 2 request object result return ref object method call object method call request object return ref

Cli/Serv.: rmiCORBA/ Being a Client and a Server Client B Client/ Server C Server D Server E Client A continued

Cli/Serv.: rmiCORBA/1343 v Usually, a client can be single-threaded, and a server should be multi-threaded. v In mixed-mode, the client may need to be multi-threaded to handle its server role.

Cli/Serv.: rmiCORBA/1344 A Mixed-mode single-threaded Problem client/ server 1 method call client/ server 2 suspended X deadlock waits forever

Cli/Serv.: rmiCORBA/1345 Multi-threaded Solution method call suspended result thread exits client/ server 1 client/ server 2 method call result thread exits

Cli/Serv.: rmiCORBA/ Blocking vs. One-way client server method call result suspended busy Blocking processing resumes

Cli/Serv.: rmiCORBA/1347 client server oneway method call busy one-way processing continues method call finishes v Problem: the client has no way of knowing if the method call has succeeded.

Cli/Serv.: rmiCORBA/ Pass by Reference vs. Value client server request object result return ref object method call Pass an object by reference.

Cli/Serv.: rmiCORBA/1349 client server request object return copy of object Pass an object by value. create object continued

Cli/Serv.: rmiCORBA/1350 v If a client invokes many methods in an object, it may be better, in terms of efficiency, to copy it to the client.

Cli/Serv.: rmiCORBA/ More Details on CORBA v Beginners Java and CORBA tutorial: onlineTraining/corba/corba.html v More technical Java & CORBA tutorial: guide/idl/ v OMG Site: continued

Cli/Serv.: rmiCORBA/1352 v Java Programming with CORBA Gerald Brose and others John Wiley, 2001, 3rd ed. Books.html#Network