Object-Oriented Network Communication (OOMI) Dynamic Requests Emmerich – Chapter 6. 7.03.2003.

Slides:



Advertisements
Similar presentations
Objektorienteret Middleware (TIOOMI) Dynamic Requests.
Advertisements

II. Middleware for Distributed Systems
GridRPC Sources / Credits: IRISA/IFSIC IRISA/INRIA Thierry Priol et. al papers.
Common Object Request Broker Architecture (CORBA) By: Sunil Gopinath David Watkins.
CORBA Architecture Nitin Prabhu. Outline CORBA Object Model CORBA Architecture Static Invocation Dynamic Invocation CORBA Communication Model.
CORBA - Common Object Request Broker Architecture.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 2: Distributed Software Engineering Using CORBA Dr. Michael R. Lyu.
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
Netprog CORBA Intro1 CORBA Common Object Request Broker Architecture Based partially on Notes by D. Hollinger and Java Network Programming and Distributed.
Advanced Comm. between Distributed Objects 1 Advanced Communication Among Distributed Objects  Outline  Request synchronization  Request multiplicity.
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 Framework Eelements 1 CORBA Framework Elements  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 11: CORBA.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Principles of Object-Oriented Software Development Interface Definition Language.
A First Java ORB Application 1  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces  Interface Definition.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
II. Middleware for Distributed Systems
Project Title: Cobra Implementation on Association Service.
Communication in Distributed Systems –Part 2
Introduction to CORBA Organizational Communications and Technologies Prithvi N. Rao H. John Heinz III School of Public Policy and Management Carnegie Mellon.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 4: RPCs vs. CORBA Dr. Michael R. Lyu Computer Science & Engineering.
Dynamic Object Requests 1  Outline  Motivating Examples  Dynamic Invocation  Reflection  Designing Generic Applications.
CORBA Chapter 17 Coulouris text. Today’s Topics CORBA History and goals CORBA RMI CORBA services The Distributed Whiteboard Revisited.
September 21, 2005 Dynamic Typing in CORBA Middleware Jeff Parsons ISIS Vanderbilt University Nashville, TN.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
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.
© City University London, Dept. of Computing Distributed Systems / Distributed Systems Session 6: Implementing Distributed Systems with OMG/CORBA.
Components in GNOME 林咸禮. Outline Components in GNOME Why object model ? The uses of CORBA Implementation notes ORBit Programming.
CORBA Distributed Technology CASE STUDY Juan C. Navarro.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
Information Management NTU Interprocess Communication and Middleware.
Slide 1 CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application ITONK1.
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Objekt orienteret Netværkskommunikation CORBA Introduction & CORBA Programming.
Abhishek Bachchan Vishal Patangia
Dynamic Invocation Interface Alternative to using IDL stubs Object cannot distinguish between the two. How is DII different for the programmer?
CORBA Details Three Tier Architecture CORBA API Holders and Helpers COS Naming and Naming Contexts Transient and Persistent Objects Properties Callbacks.
Slides for Chapter 17: CORBA Case Study From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001.
CS551 - Lecture 15 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
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.
Objektorienteret Middleware (OOMI)
 Common Object Request Broker Architecture  An industry standard developed by OMG to help in distributed programming.
Distributed Objects and Remote Invocation Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Presentation 3: Designing Distributed Objects. Ingeniørhøjskolen i Århus Slide 2 af 14 Outline Assumed students are knowledgeable about OOP principles.
CORBA (Common Object Request Broker Architechture) Aniket Prabhune Varun Saini Balaprasuna Chennupati Lally Singh.
Objektorienteret Netværkskommunikation (ITONK1) CORBA Introduction.
January 25, 2016 First experiences with CORBA Niko Neufeld.
CS551 - Lecture 12 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Slide 1 of 15 © Ingeniørhøjskolen i Århus CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application.
1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network.
Presentation: Special Repetition Recap on Distributed Principles.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Presentation 24 Ultra Simple.NET Remoting to CORBA bridge.
CEN6502, Spring Understanding the ORB: Client Side Structure of ORB (fig 4.1) Client requests may be passed to ORB via either SII or DII SII decide.
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
Only small steps in CORBA programming – much complexity
Broker in practice: Middleware
Object-Oriented Network Communication (OOMI)
CORBA (Common Object Request Broker Architecture)
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CORBA Programming B.Ramamurthy Chapter 3 5/2/2019.
Copyright © 2001 Qusay H. Mahmoud
Presentation transcript:

Object-Oriented Network Communication (OOMI) Dynamic Requests Emmerich – Chapter

Slide 2 of 27 © Ingeniørhøjskolen i Århus Outline 1. Dynamic Invocation The CORBA Dynamic Invocation Interface 2. Reflection The CORBA Interface Repository

Slide 3 of 27 © Ingeniørhøjskolen i Århus What is a Dynamic Request? Sometimes clients need to be built before their server interfaces are defined They need to defer request definition until they are executed These are dynamic requests Examples: –Object browser –Automatic test programmes

Slide 4 of 27 © Ingeniørhøjskolen i Århus Motivating Example: Object Browser

Slide 5 of 27 © Ingeniørhøjskolen i Århus Commonalities Discovery of type information at run-time Use of type information to build client objects that can cope with any type of server objects Definition of object requests at run-time Requires two primitives from middleware: –Dynamic invocation interfaces –Reflection mechanisms

Slide 6 of 27 © Ingeniørhøjskolen i Århus 1. Dynamic Requests: Principles Any object request has to identify –server object –operation name –actual parameters –data structure for operation result In Dynamic Requests: –server object identified by object reference –operation name identified by string –actual parameters as list of name/value pairs –operation result determined by an address

Slide 7 of 27 © Ingeniørhøjskolen i Århus Dynamic Invocation Client Stubs ORB Interface Implementation Skeletons Client Object Implementation ORB Core Object Adapter Dynamic Requests in CORBA

Slide 8 of 27 © Ingeniørhøjskolen i Århus Dynamic Requests in CORBA Dynamic invocation interface (DII) supports dynamic creation of requests Requests are objects themselves Request objects have attributes for operation name, parameters and results Request objects have operations to –change operation parameters –issue the request and –obtain the request results

Slide 9 of 27 © Ingeniørhøjskolen i Århus Dynamic Request in CORBA :Client rr:Request :Server Op() r=create_request(…,”Op”,…) add_arg()invoke() delete()

Slide 10 of 27 © Ingeniørhøjskolen i Århus Using DII with Java … //obtain the obj stub – e.g. from IOR org.omg.CORBA.Object obj = orb.string_to_object(ref) ; // Create a DII request and set the arguments and result org.omg.CORBA.Request r = obj._request("sayHello"); r.set_return_type(orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); // call the Hello server object and print results r.invoke(); java.lang.Exception ex = r.env().exception(); //handling of exception … // extract the result String result; result = r.return_value().extract_string(); System.out.println("Result from DII: " + result + "Now without stubs!");

Slide 11 of 27 © Ingeniørhøjskolen i Århus Creating Dynamic CORBA Requests interface Object { ORBstatus create_request( in Context ctx, // operation context in Identifier operation,// operation to exec in NVList arg_list, // args of operation inout NamedValue result,// operation result out Request request // new request object in Flags req_flags // request flags );... };

Slide 12 of 27 © Ingeniørhøjskolen i Århus Manipulating Dynamic CORBA Requests interface Request { Status add_arg ( in Identifier name, // argument name in TypeCode arg_type,// argument datatype in void* value, // argument to be added in long length, // length of argument value in Flags arg_flags // argument flags ); Status invoke( in Flags invoke_flags // invocation flags ); Status send( in Flags invoke_flags // invocation flags ); Status get_response( in Flags response_flags // response flags ) raises (WrongTransaction); Status delete(); };

Slide 13 of 27 © Ingeniørhøjskolen i Århus Transparency of Dynamic Invocation In both COM and CORBA: –Client programs have to be written differently  Use of dynamic invocation interfaces is not transparent to client programmers In COM: –Interfaces of server objects have to be designed as dual  Use of dynamic invocation not transparent in server design In CORBA: –Server objects are unaware of dynamic invocation –  Use of DII is transparent

Slide 14 of 27 © Ingeniørhøjskolen i Århus 2. Reflection Principles How do clients discover attributes & operations that servers have? Need to –capture type information during interface compilation –store type information persistently –provide an interface for clients to obtain type information during run-time Reflection interfaces provided by –CORBA Interface Repository

Slide 15 of 27 © Ingeniørhøjskolen i Århus CORBA Interface Repository Service Makes type information of interfaces available at run-time Achieves type-safe dynamic invocations Supports construction of interface browser Used by CORBA implementations themselves (need a IR server running) –Not supported by Orbacus Java & SUNs ORB –Very vendor specifik implementation Persistent storage of IDL interfaces in abstract syntax trees (ASTs)

Slide 16 of 27 © Ingeniørhøjskolen i Århus Interface repository persistently stores ASTs of IDL modules, interfaces, types, operations etc. module SoccerMgmt { }; ModuleDef SoccerMgmt InterfaceDef Player interface Player; InterfaceDef Team interface Team { }; TypedefDef PlayerList typedef sequence PlayerList; ExceptionDef InvalidNumber exception InvalidNumber{} ; AttributeDef members attribute PlayerList members; OperationDef add void add(in short number, in Player p); raises(InvalidNumber) Abstract Syntax Trees (ASTs)

Slide 17 of 27 © Ingeniørhøjskolen i Århus Container AST Node Types IRObject Contained OperationDef ExceptionDef TypedefDef AttributeDef ConstantDef ModuleDef InterfaceDef Repository

Slide 18 of 27 © Ingeniørhøjskolen i Århus Container (node with children) interface Container : IRObject { Contained lookup (in ScopedName search_name); sequence contents( in DefinitionKind limit_type, in boolean exclude_inherited); sequence lookup_name ( in Identifier search_name, in long levels_to_search, in DefinitionKind limit_type, in boolean exclude_inherited);... };

Slide 19 of 27 © Ingeniørhøjskolen i Århus Contained (child) interface Contained : IRObject { attribute Identifier name; attribute RepositoryId id; attribute VersionSpec version; readonly attribute Container defined_in ; struct Description { DefinitionKind kind; any value; }; Description describe ();... };

Slide 20 of 27 © Ingeniørhøjskolen i Århus Interface Definition interface InterfaceDef : Container,Contained { attribute sequence base_interfaces; boolean is_a (in RepositoryId interface_id); struct FullInterfaceDescription { Identifier name; RepositoryId id; RepositoryId defined_in; RepositoryIdSequence base_interfaces; sequence operations; sequence attributes;... }; FullInterfaceDescription describe_interface (); };

Slide 21 of 27 © Ingeniørhøjskolen i Århus Locating CORBA Interface Definitions Alternatives: Any interface inherits the operation InterfaceDef get_interface() from Object Associative search using lookup_name() Navigation through the interface repository using contents and defined_in attributes

Slide 22 of 27 © Ingeniørhøjskolen i Århus Example: Object Browser Use run-time type information to find out about –object types and –attribute names Use dynamic invocation interfaces to obtain attribute values

Slide 23 of 27 © Ingeniørhøjskolen i Århus :Browser p:Player i:InterfaceDefr1: Request i=get_interface() name() r1=create_request(…,“Name”,…) describe_interface() invoke() r2=create_request(…,“Number”,…) r2: Request invoke() Name() delete()Number() delete() Object Browser in CORBA Reflection part Invocation part

Slide 24 of 27 © Ingeniørhøjskolen i Århus CORBA Java Reflection I // Java import org.omg.CORBA.*;... org.omg.CORBA.ORB =... // initialize the ORB org.omg.CORBA.Object obj =... // get object reference somehow org.omg.CORBA.Object defObj = obj._get_interface_def(); if(defObj == null) { System.err.println("No Interface Repository available"); System.exit(1); } InterfaceDef def = InterfaceDefHelper.narrow(defObj); org.omg.CORBA.InterfaceDefPackage.FullInterfaceDescription desc = def.describe_interface();

Slide 25 of 27 © Ingeniørhøjskolen i Århus CORBA Java Reflection II int i; System.out.println("name = " + desc.name); System.out.println("id = " + desc.id); System.out.println("defined_in = " + desc.defined_in); System.out.println("version = " + desc.version); System.out.println("operations:"); for(i = 0 ; i < desc.operations.length ; i++) { System.out.println(i + ": " + desc.operations[i].name); } System.out.println("attributes:"); for(i = 0 ; i < desc.attributes.length ; i++) { System.out.println(i + ": " + desc.attributes[i].name); } System.out.println("base_interfaces:"); for(i = 0 ; i < desc.base_interfaces.length ; i++) { System.out.println(i + ": " + desc.base_interfaces[i]); }

Slide 26 of 27 © Ingeniørhøjskolen i Århus Static Invocation Advantages: –Requests are simple to define –Availability of operations checked by programming language compiler –Requests can be implemented fairly efficiently Disadvantages: –Generic applications cannot be build –Recompilation required after operation interface modification

Slide 27 of 27 © Ingeniørhøjskolen i Århus Dynamic Invocation Advantages: –Components can be built without having the interfaces they use –Higher degree of concurrency through deferred synchronous execution –Components can react to changes of interfaces Disadvantages: –Less efficient –More complicated to use and –Not type safe! –And not supported by all