Similar documents
Introduction to Distributed Computing using CORBA

Netscape Internet Service Broker for C++ Programmer's Guide. Contents

Infrastructure that supports (distributed) componentbased application development

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

CORBA Programming with TAOX11. The C++11 CORBA Implementation

Distributed Network Management Using SNMP, Java, WWW and CORBA

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)


Middleware Lou Somers

Introduction CORBA Distributed COM. Sections 9.1 & 9.2. Corba & DCOM. John P. Daigle. Department of Computer Science Georgia State University

Module 17. Client-Server Software Development. Version 2 CSE IIT, Kharagpur

COMMMUNICATING COOPERATING PROCESSES

3F6 - Software Engineering and Design. Handout 10 Distributed Systems I With Markup. Steve Young

An Incomplete C++ Primer. University of Wyoming MA 5310

CORBAservices. Naming. Part of the CORBA Naming Service Interface in IDL. CORBA Naming Service

Getting Started with the Internet Communications Engine

Curriculum Map. Discipline: Computer Science Course: C++

C++ INTERVIEW QUESTIONS

Interface Definition Language

Load Balancing in CORBA: A Survey. Response to the Aggregated Computing RFI

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

The C Programming Language course syllabus associate level

: provid.ir

Corba. Corba services. The (very) global picture. Corba. Distributed Object Systems 3 CORBA/IDL. Corba. Features. Services

MPLAB Harmony System Service Libraries Help

Remote Method Invocation

What is COM/DCOM. Distributed Object Systems 4 COM/DCOM. COM vs Corba 1. COM vs. Corba 2. Multiple inheritance vs multiple interfaces

A Web-Based Real-Time Traffic Monitoring Scheme Using CORBA

PERFORMANCE COMPARISON OF COMMON OBJECT REQUEST BROKER ARCHITECTURE(CORBA) VS JAVA MESSAGING SERVICE(JMS) BY TEAM SCALABLE

Object Oriented Software Design II

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

El Dorado Union High School District Educational Services

N3458: Simple Database Integration in C++11

AN IMPROVED REAL-TIME TRAFFIC FLOW MONITORING SCHEME

APPLICATION CODE APPLICATION CODE S ERVER PROCESS STUB STUB RPC RUNTIME LIBRARY RPC RUNTIME LIBRARY ENDPOINT MAP ENDPOINT MAP

Distributed Applications with CORBA. Frank Kargl Chaos Computer Club, Ulm, Germany

Objectif. Participant. Prérequis. Remarque. Programme. C# 3.0 Programming in the.net Framework. 1. Introduction to the.

Implementing Java Distributed Objects with JDBC

Elements of Advanced Java Programming

Software Quality Factors OOA, OOD, and OOP Object-oriented techniques enhance key external and internal software quality factors, e.g., 1. External (v

Java (12 Weeks) Introduction to Java Programming Language

CORBA, DCOP and DBUS. A performance comparison.

CORBA. BY VIRAJ N BHAT

Middleware and Distributed Systems. Introduction. Dr. Martin v. Löwis

RTI Routing Service. Release Notes

Evolution of the Major Programming Languages

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Middleware. Chapter 8: Middleware

Course MS10975A Introduction to Programming. Length: 5 Days

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Reactor. An Object Behavioral Pattern for Demultiplexing and Dispatching Handles for Synchronous Events. Douglas C. Schmidt

Chapter 2: Remote Procedure Call (RPC)

Moving from CS 61A Scheme to CS 61B Java

C++FA 5.1 PRACTICE MID-TERM EXAM

Ubuntu. Ubuntu. C++ Overview. Ubuntu. History of C++ Major Features of C++

Glossary of Object Oriented Terms

CORBA Objects in Python

Remote Method Invocation in JAVA

IS0020 Program Design and Software Tools Midterm, Feb 24, Instruction

Report of the case study in Sistemi Distribuiti A simple Java RMI application

Logging. Working with the POCO logging framework.

An Overview of Java. overview-1

CS506 Web Design and Development Solved Online Quiz No. 01

Status of the CORBA Firewall Traversal RFP

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

It is the thinnest layer in the OSI model. At the time the model was formulated, it was not clear that a session layer was needed.

Distributed Internet Applications - DIA. Principles of Object-Oriented Middleware

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

C#5.0 IN A NUTSHELL. Joseph O'REILLY. Albahari and Ben Albahari. Fifth Edition. Tokyo. Sebastopol. Beijing. Cambridge. Koln.

A Management Tool for Component-Based Real-Time Supervision and Control Systems

Konzepte objektorientierter Programmierung

Programming with the Microsoft.NET Framework Using Microsoft Visual Studio 2005 (VB)

Event-based middleware services

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

System types. Distributed systems

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

CORBA I An Introduction To CORBA CptS 464/564 Sept 2, 2004

VisiBroker Configuration Reference


Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Chapter 3 Using the ACE Logging Facility

A Meeting Room Scheduling Problem

TypeScript for C# developers. Making JavaScript manageable

Load balancing using Remote Method Invocation (JAVA RMI)

Java Application Developer Certificate Program Competencies

Java and Distributed Object Models: An Analysis

MSP430 C/C++ CODE GENERATION TOOLS Compiler Version 3.2.X Parser Error/Warning/Remark List

An Architectural View of Distributed Objects and Components in CORBA, Java RMI, and COM/DCOM

Transcription:

Introduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized programs Easier said than done due to: Writing CORBA Applications. Partial failures. Impact of latency Dr. Douglas C. Schmidt schmidt@cs.wustl.edu. Load balancing. Event ordering 2. Providing an infrastructure to integrate application components into a distributed system i.e., CORBA is an \enabling technology" 1 2 General ORB structure CORBA Interface Denition Language (IDL) OMG IDL is an object-oriented interface denition language Used to specify interfaces containing methods and attributes OMG IDL support interface inheritance (both single and multiple inheritance) OMG IDL is designed to map onto multiple programming languages Note that an ORB is a logical set of services, rather than just a particular process or library e.g., C, C++, Smalltalk, COBOL, Modula 3, DCE, etc. 3 4

OMG IDL Compiler A OMG IDL compiler generates client stubs and server skeletons Stubs and skeletons automate the following activities (in conjunction with the ORB): Client proxy factories OMG IDL Features OMG IDL is a superset of a subset of C++ Note, it is not a complete programming language, it only denes interfaces OMG IDL supports the following features: Parameter marshalling/demarshalling Implementation class interface generation Object registration and activation Object location and binding Per-object/per-process lters * modules * interfaces * methods * attributes * inheritance *arrays * sequence * struct, enum, union, typedef * consts * exceptions 5 6 A Sample CORBA Application OMG IDL vs. C++ Dierences from C++ * No data members * No pointers * No constructors or destructors * No overloaded methods *No int data type * Contains parameter passing modes * Unions require a tag * String type * Sequence type * Dierent exception interface * No templates * No control constructs Distributed logging facility 7 8

Server-side OMG IDL Specication Behavior of the Distributed Logging Facility The logging server collects, formats, and outputs logging records forwarded from applications residing throughout a network or internetwork An application interacts with the server logger via a CORBA interface Denes the interface of the Logger // IDL specification interface Logger // Types of logging messages enum Log_Priority LOG_DEBUG, // Debugging messages LOG_WARNING, // Warning messages LOG_ERROR, // Errors LOG_EMERG // A panic condition, normally broadcast ; exception Disconnected ; struct Log_Record Log_Priority type; // Type of logging record. long host_addr; // IP address of the sender. long time; // Time logging record generated. long pid; // Process ID of app. generating the record. sequence<char> msg_data; // Logging record data. ; // Transmit a Log_Record to the logging server void log (in Log_Record log_rec) raises (Disconnected); attribute boolean verbose; // Use verbose formatting ; 9 10 OMG IDL Mapping Rules The CORBA specication denes mappings from CORBA IDL to various programming languages e.g., C++, C, Smalltalk Mapping OMG IDL to C++ Each interface is mapped to a nested C++ class Creating Server-side Implementations Running the Logger interface denition through the IDL compiler generates a client stub and a server skeleton The client stub acts as a proxy and handles object binding and parameter marshalling The server skeleton handles object registration, activation, and parameter demarshalling Each operation is mapped to a C++ method with appropriate parameters Each read/write attribute is mapped to a pair of get/set methods. A read-only attribute is only mapped to a single get method CORBA denes two techniques for generating server skeletons: 1. Inheritance-based implementations (e.g., Orbix BOAImpl) 2. Object composition-based implemenations (e.g., Orbix TIE) 11 12

Inheritance-based Implementations Object Composition-based Implementations In Orbix, inheritance-based implementations are supported by the BOAImpl approach: The drawback with this approach is that the implementation must inherit from the generated skeleton class Logger_i // Note the use of inheritance from automatically // generated class LoggerBOAImpl : public virtual LoggerBOAImpl public: Logger_i (bool verb): verbose_ (verb) virtual void log (const Log_Record &log_rec, virtual bool verbose (void, virtual void verbose (bool enable, private: bool verbose_; ; In Orbix, object composition-based implementations are supported by the TIE approach: // Note, there is no use of inheritance and // methods need not be virtual! class Logger_i public: // Start with verbose mode enabled. Logger_i (bool verb = true): verbose_ (verb) void log (const Log_Record &log_rec, bool verbose (void, void verbose (bool enable, private: bool verbose_; ; 13 14 Writing the Server-side Method Object Composition-based Implementations (cont'd) Orbix provides a set of macros that tie the Logger interface together with the Logger i implementation DEF_TIE (Logger, Logger_i); Logger_i *log = new Logger_i; Logger *logger = new TIE (Logger, Logger_i) (log); This scheme works by placing a pointer to the implementation object within the TIE class and then delegating method calls to the implementation object Denitions Using either the BOAImpl or the TIE approach, a developer then writes C++ denitions for the methods in class Logger i: void Logger_i::log (const Log_Record &log_rec, CORBA::Environment &) // Formatting and outputting the contents // of log_rec omitted... bool Logger_i::verbose (void, return this->verbose_; void Logger_i::verbose (bool enabled, this->verbose_ = enabled; 15 16

Writing Main Server Program Exception Handling The main program for the logging server looks like: // Shared activation int main (void) // BOAImpl instance. Logger_i logger (); try // Will block forever waiting for incoming // invocations and dispatching method callbacks CORBA::Orbix.impl_is_ready ("Logger"); catch (...) cerr << "server failed\n"; return 1; cout << "server terminating\n"; return 0; The preceeding example illustrated how CORBA uses C++ exception handling to propagate errors. However, many C++ compilers don't support exceptions yet Therefore, CORBA implementations provide an alternative mechanism for handling errors // Shared activation int main (void) // Start with verbose mode enabled Logger_i logger (true); TRY // Will block forever waiting for incoming // invocations and dispatching method callbacks CORBA::Orbix.impl_is_ready ("logger", IT_X); CATCHANY cerr << "server failed due to " << IT_X << endl; ENDTRY; cout << "server terminating\n"; return 0; 17 18 Object Activation Generated Client-side Stubs If the service isn't running when a client invokes a method on an object it manages, the ORB will automatically start the service Services must be registered with the ORB, e.g., % putit Logger /usr/svcs/logger/logger.exe Service(s) may be installed on any machine Clients may bind to a service by using a location broker or by explicitly naming the server The OMG IDL compiler automatically generates a client-side stub used to dene \proxy objects," e.g., typedef Logger *LoggerRef; // Generated by Orbix class Logger // Base class for all IDL interfaces... : public virtual CORBA::Object public: static Logger *_bind (/* Many binding formats */); virtual void log (const Log_Record &log_rec, virtual void verbose (bool enabled, virtual bool verbose (void, ; 19 20

Client-side Example Binding a Client to a Target Object Steps for binding a client to a target object 1. A CORBA client (requestor) obtains an \object reference" from a server May use a name service or locator service 2. This object reference serves as a local proxy for the remote target object Object references may be passed as parameters to other remote objects 3. The client may then invoke methods on its proxy A client programmer writes the following: int main (void) LoggerRef logger; Log_Record log_rec; logger = Logger::_bind (); // Bind to any logger. // Initialize the log_record log_rec.type = Logger::LOG_DEBUG; log_rec.time = ::time (0); log_rec.host_addr = //... //... try logger->verbose (false); // Disable verbose logging. logger->log (log_rec); // Xmit logging record. catch (Logger::Disconnected) cerr << "logger disconnected" << endl; catch (...) /*... */ return 0; 21 22 Summary CORBA helps to reduce the complexity of developing distributed applications However, there are many hard issues remaining: :: Other OMG documents (e.g., COSS) specify higher level e.g., transactions, events, naming, security, etc. 23