// messenger.idl interface Messenger { boolean send_message ( in string user_name, in string subject, inout string message ); };

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

Slide 1 Objektorienteret Middleware (OOMI) CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application.
Passing Streams to Functions. Passing Streams to Functions One Rule: always pass a stream as a reference.
Netprog CORBA Intro1 CORBA Common Object Request Broker Architecture Based partially on Notes by D. Hollinger and Java Network Programming and Distributed.
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)
A First Java ORB Application 1  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces  Interface Definition.
IDL Interface Definition Language. IDL products Interface repository Dynamic Interface Static skeletons Client IDL stubs Dynamic skeletons Server Object.
II. Middleware for Distributed Systems
General Computer Science for Engineers CISC 106 Lecture 33 Dr. John Cavazos Computer and Information Sciences 05/11/2009.
Outline CORBA Programming Elements CORBA Programming Elements Server & Client Basics Server & Client Basics IDL Compiler IDL Compiler CORBA Naming Service.
1 Chapter 8 Scope, Lifetime, and More on Functions Dale/Weems/Headington.
1 Aniruddha Gokhale Vanderbilt University, Spring 2003 Intro to TAO Programming Study the Hello example in ACE_wrappers/TAO/tests –Show IDL definition,
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
1 Chapter 9 Scope, Lifetime, and More on Functions.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Wireless CORBA Richard Verhoeven. Content Quick Introduction to CORBA Wireless & Mobile Wireless CORBA Test Case Conclusions.
Distributed Systems Architectures
Components in GNOME 林咸禮. Outline Components in GNOME Why object model ? The uses of CORBA Implementation notes ORBit Programming.
Slide 1 © Ingeniørhøjskolen i Århus TIMICO Middleware with CORBA.
DCOM-CORBA Comparison Operating Systems II Reference: P. Chung et al., DCOM and CORBA: side by side, step by step,and layer by layer, C++ Report.
1 of of 25 3 of 25 ORBs (Object Request Broker) – A distributed software bus for communication among middleware services and applications – To.
Slide 1 CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application ITONK1.
Robb Myer CPSC611 Common Object Request Broker Architecture (CORBA) Free Flight Simulation Laboratory NASA Langley Research Center.
Commercial Component Based Design (Part 2) Corba OLE ActiveX This segment prepared and presented by John Champaign
1 Linked Stack Chapter 4. 2 Linked Stack We can implement a stack as a linked list. Same operations. No fixed maximum size. Stack can grow indefinitely.
ITEC 320 C++ Examples.
Abhishek Bachchan Vishal Patangia
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
CORBA – Command Line CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Vakgroep Informatietechnologie - IBCN CORBA & RMI Design of Distributed Software.
Chapter 8 Scope of variables Name reuse. Scope The region of program code where it is legal to reference (use) a variable The scope of a variable depends.
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
Parallel CORBA Objects CORBA May, 22 nd 2000 ARC « Couplage » Christophe René (IRISA/IFSIC)
CORBA – Eclipse CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
File I/O in C++ II. Open() function Open() is a member function in each classes ( fstream, ifstream, ofstream) Void fstream :: open ( const char *filename,
CSE 332: C++ IO We’ve Looked at Basic Input and Output Already How to move data into and out of a program –Using argc and argv to pass command line args.
Server-Side C++ Mapping Copyright © ZeroC, Inc. Ice Programming with C++ 6. Server-Side C++ Mapping.
Quiz // // The function exchanges the two parameters. // Param: ( ) // Param:
Get_gmt 函数在 windows 下的实现 TimeOfDay TimeImpl:: get_gmt() throw(CORBA::SystemException) {time_t time_now=time(0); = time_t time_now=time(NULL); struct tm*
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.
Distributed Object-Oriented Programming (1) – Socket, RPC, 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.
C++ Namespaces, Exceptions CSci 588: Data Structures, Algorithms and Software Design All material not from online sources copyright © Travis Desell, 2011.
Netprog: More Corba1 CORBA Continued. Netprog: More Corba2 CORBA Terminology ORB - Object Request Broker IR – Implementation Repository IDL – Interface.
Object-Oriented Middleware (OOMI) Locating Distributed Objects Emmerich – Chapter
1 C++ Classes and Data Structures Course link…..
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
MT262A Review.
Only small steps in CORBA programming – much complexity
Command Line Arguments
Understand argc and argv
Interface Definition Language
Structure of C Programs
More Examples of argc and argv
Yung-Hsiang Lu Purdue University
null, true, and false are also reserved.
More About File Reading
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CASE Study: CORBA (if time, QuO)
DCOM-CORBA Comparison
اصول کامپیوتر ۱ مبانی کامپیوتر و برنامه‌سازی
Wireless CORBA Richard Verhoeven.
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Building a CORBA Server
Standard Input/Output Stream
Remote Procedure Call (invocation) RPC
Function Overloading.
Presentation transcript:

// messenger.idl interface Messenger { boolean send_message ( in string user_name, in string subject, inout string message ); };

module BankExample { interface Account { exception BadCheck { float fee; }; float deposit(in float amount); float writeCheck(in float amount) raises (BadCheck); }; interface AccountManager { Account openAccount(in string name); };

(c) 2001 A. David McKinnon, used with permission CORBA Diagram IDL Skeleton IDL Stub Object Implementation (Servant) Client Request Object Request Broker IDL File

#include class Messenger_impl : public POA_Messenger, public PortableServer::RefCountServantBase { public: virtual bool send_message (const char* user_name, const char* subject, char*& message) throw(CORBA::SystemException); };

int main(int argc, char *argv[]) { int status = EXIT_SUCCESS; CORBA::ORB_var orb; try { orb = CORBA::ORB_init(argc,argv); status = run(orb); } catch(const CORBA::Exception&) { status = EXIT_FAILURE; } if (!CORBA::is_nil(orb)) { try { orb->destroy(); } catch(const CORBA::Exception&) { status = EXIT_FAILURE; } } return status; }

int run(CORBA::ORB_ptr orb) { const char* refFile = "Messenger.ref"; ifstream in(refFile); char s [2048]; in >> s; in.close(); CORBA::Object_var obj = orb->string_to_object(s); CORBA::String_var message = CORBA::string_dup("Howdy!"); Messenger_var messenger = Messenger::_narrow(obj); if (messenger->send_message("hauser", "Test message", message.inout())) { cout << "server ok" << endl; cout << "Return message from server: " << message << endl; } else { cout << "server returned false" << endl; cout << "Return message from server: " << message << endl; } return 0; }

int run(CORBA::ORB_ptr orb) { CORBA::Object_var poaObj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var rootPoa = PortableServer::POA::_narrow(poaObj); PortableServer::POAManager_var manager = rootPoa->the_POAManager(); Messenger_impl* messengerImpl = new Messenger_impl(); PortableServer::ServantBase_var servant = messengerImpl; Messenger_var messenger = messengerImpl -> _this(); CORBA::String_var s = orb -> object_to_string(messenger); const char* refFile = "Messenger.ref"; ofstream out(refFile); out << s << endl; out.close(); manager -> activate(); orb->run(); return EXIT_SUCCESS; }