BEA Tuxedo. Creating CORBA Client Applications

Similar documents
BEA Tuxedo. Creating CORBA Server Applications

BEA Tuxedo. Using the CORBA Name Service

BEA WebLogic Enterprise. Using the WebLogic EJB Deployer

BEA WebLogic Commerce Server. Registration and User Processing Package

BEA Tuxedo. Using the CORBA Notification Service

BEA Tuxedo. Using the BEA Tuxedo Workstation Component

Web OS Switch Software

Baan Tools User Management

BEA WebLogic Process Integrator

Python Programming: An Introduction to Computer Science

Adapter for Mainframe

3.1 Overview of MySQL Programs. These programs are discussed further in Chapter 4, Database Administration. Client programs that access the server:

JavaFX. JavaFX 2.2 Installation Guide Release 2.2 E August 2012 Installation instructions by operating system for JavaFX 2.

BEA WebLogic Portal. JSP Commerce and Campaign Tour

Baan Finance Financial Statements

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

BEA WebLogic Portal. Guide to Events and Behavior Tracking

BEA WebLogic Server. Programming WebLogic Enterprise JavaBeans

BEA WebLogic XML/Non-XML Translator

BEA WebLogic Application Integration A Component of BEA WebLogic Integration. Adapter Development Guide

Installing the BEA WebLogic Commerce Servers. including the Personalization Server and Commerce Server Components

BEA Tuxedo. Using the BEA Tuxedo System on Windows NT

BEA WebLogic Server. Installing and Setting up WebLogic Server 5.1

Architectural styles for software systems The client-server style

BAAN IVc/BaanERP. Conversion Guide Oracle7 to Oracle8

BEA WebLogic Collaborate

MOTIF XF Extension Owner s Manual

Customer Portal Quick Reference User Guide

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

One advantage that SONAR has over any other music-sequencing product I ve worked

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

TargetLink. Installation Notes. MATLAB R14SP3 Compatibility Update for TargetLink 2.1

BEA Tuxedo. Using CORBA Server-to-Server Communication

Avid Interplay Bundle

BEA elink Business Process Option Server Installation Guide

Τεχνολογία Λογισμικού

1 Enterprise Modeler

BEA WebLogic XML/Non-XML Translator

Goals of the Lecture UML Implementation Diagrams

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

BEA WebLogic. Integration. Best Practices in Designing BPM Workflows

Getting Started. Getting Started - 1

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

BEA WebLogic XML/Non-XML Translator. Samples Guide

Python Programming: An Introduction to Computer Science

BEA elink Business Process Option User s Guide

Code Review Defects. Authors: Mika V. Mäntylä and Casper Lassenius Original version: 4 Sep, 2007 Made available online: 24 April, 2013

BEA Liquid Data for. WebLogic. Deploying Liquid Data

Chapter 11 Web-based Information Systems

Custodial Integrator Automation Guide

BAAN IV. BAAN IV Installation Manual for DB2 on Windows NT

Data diverse software fault tolerance techniques

BEA Tuxedo. Using the BEA Tuxedo Domains Component

BEA WebLogic Java Adapter for Mainframe. Reference Guide

Security of Bluetooth: An overview of Bluetooth Security

System and Software Architecture Description (SSAD)

1 Oracle Data Integrator Console Issues and Workarounds

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

Human-Computer Interaction IS4300

Weston Anniversary Fund

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June

BEA WebLogic. Adapter for . Installation and Configuration Guide for WebLogic Integration 7.0

Configuring Rational Suite

Elementary Educational Computer

GE FUNDAMENTALS OF COMPUTING AND PROGRAMMING UNIT III

BEAWebLogic. Integration. Release Notes

Computers and Scientific Thinking

CS 11 C track: lecture 1

K-NET bus. When several turrets are connected to the K-Bus, the structure of the system is as showns

User Guide. Using Caliber Datamart

. Written in factored form it is easy to see that the roots are 2, 2, i,

L I N U X. Unit 6 S Y S T E M DHCP & DNS (BIND) A D M I N I S T R A T I O n DPW

Chapter 4 Remote Procedure Calls and Distributed Transactions

BEA WebLogic. Adapter for HL7. Installation and Configuration Guide for WebLogic Integration 7.0

Chapter 4 Threads. Operating Systems: Internals and Design Principles. Ninth Edition By William Stallings

Chapter 8. Strings and Vectors. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

The Magma Database file formats

Workflow Extensions User Guide. StarTeam 12.0

BaanERP. DB2 Installation Guide for BaanERP on Windows NT

Application Notes for Configuring Dasan Electron Headsets from JPL Europe with Avaya 9600 Series IP Deskphones using a DA-30 Cord Issue 1.

TUTORIAL Create Playlist Helen Doron Course

Creating Test Harnesses and Starter Applications

WYSE Academic Challenge Sectional Computer Science 2005 SOLUTION SET

L5355 Modbus Plus Communications Interface

Software development of components for complex signal analysis on the example of adaptive recursive estimation methods.

A SOFTWARE MODEL FOR THE MULTILAYER PERCEPTRON

n Explore virtualization concepts n Become familiar with cloud concepts

Chapter 8. Strings and Vectors. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Avid recommends that you read all the information in this ReadMe file thoroughly before installing or using any new software release.

Data Warehousing. Paper

Princeton Instruments Reference Manual

Basic Design Principles

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

In this chapter, you learn the concepts and terminology of databases and

Guide to Applying Online

Schema for the DCE Security Registry Server

BEA Tuxedo. Introducing the BEA Tuxedo System

Transcription:

BEA Tuxedo Creatig CORBA Cliet Applicatios BEA Tuxedo 8.0 Documet Editio 8.0 Jue 2001

Copyright Copyright 2001 BEA Systems, Ic. All Rights Reserved. Restricted Rights Leged This software ad documetatio is subject to ad made available oly pursuat to the terms of the BEA Systems Licese Agreemet ad may be used or copied oly i accordace with the terms of that agreemet. It is agaist the law to copy the software except as specifically allowed i the agreemet. This documet may ot, i whole or i part, be copied, photocopied, reproduced, traslated, or reduced to ay electroic medium or machie-readable form without prior coset, i writig, from BEA Systems, Ic. Use, duplicatio or disclosure by the U.S. Govermet is subject to restrictios set forth i the BEA Systems Licese Agreemet ad i subparagraph (c)(1) of the Commercial Computer Software-Restricted Rights Clause at FAR 52.227-19; subparagraph (c)(1)(ii) of the Rights i Techical Data ad Computer Software clause at DFARS 252.227-7013, subparagraph (d) of the Commercial Computer Software--Licesig clause at NASA FAR supplemet 16-52.227-86; or their equivalet. Iformatio i this documet is subject to chage without otice ad does ot represet a commitmet o the part of BEA Systems. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. FURTHER, BEA Systems DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE OR WRITTEN MATERIAL IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. Trademarks or Service Marks BEA, WebLogic, Tuxedo, ad Jolt are registered trademarks of BEA Systems, Ic. How Busiess Becomes E-Busiess, BEA WebLogic E-Busiess Platform, BEA Builder, BEA Maager, BEA elik, BEA WebLogic Commerce Server, BEA WebLogic Persoalizatio Server, BEA WebLogic Process Itegrator, BEA WebLogic Collaborate, BEA WebLogic Eterprise, ad BEA WebLogic Server are trademarks of BEA Systems, Ic. All other compay ames may be trademarks of the respective compaies with which they are associated. Creatig CORBA Cliet Applicatios Documet Editio Date Software Versio 8.0 Jue 2001 BEA Tuxedo 8.0

Cotets About This Documet What You Need to Kow... vii e-docs Web Site... viii How to Prit the Documet... viii Related Iformatio... viii Cotact Us!... ix Documetatio Covetios... ix 1. CORBA Cliet Applicatio Developmet Cocepts Overview of Cliet Applicatios... 1-2 OMG IDL... 1-3 OMG IDL-to-C++ Mappig... 1-3 OMG IDL-to-Java Mappig... 1-3 OMG IDL-to-COM Mappig... 1-4 Static ad Dyamic Ivocatio... 1-4 Cliet Stubs... 1-6 Iterface Repository... 1-7 Domais... 1-8 Evirometal Objects... 1-9 Bootstrap Object... 1-11 Factories ad the FactoryFider Object... 1-13 Namig Covetios ad BEA Tuxedo Extesios to the FactoryFider Object... 1-14 IterfaceRepository Object... 1-16 SecurityCurret Object... 1-17 TrasactioCurret Object... 1-18 NotificatioService ad Tobj_SimpleEvetsService Objects... 1-19 Creatig CORBA Cliet Applicatioss iii

NameService Object... 1-20 Cocepts for ActiveX Cliet Applicatios... 1-20 What Is ActiveX?... 1-20 Views ad Bidigs...1-21 Namig Covetios for ActiveX Views... 1-22 2. Creatig CORBA Cliet Applicatios Summary of the Developmet Process for CORBA C++ Cliet Applicatios. 2-2 Summary of the Developmet Process for CORBA Java Cliet Applicatios. 2-3 Step 1: Obtaiig the OMG IDL File... 2-4 Step 2: Selectig the Ivocatio Type... 2-6 Step 3: Compilig the OMG IDL File... 2-6 Step 4: Writig the CORBA Cliet Applicatio... 2-8 Iitializig the ORB... 2-8 Establishig Commuicatio with the BEA Tuxedo Domai... 2-9 Resolvig Iitial Refereces to the FactoryFider Object... 2-11 Usig the FactoryFider Object to Get a Factory... 2-11 Usig a Factory to Get a CORBA Object... 2-13 Step 5: Buildig the CORBA Cliet Applicatio... 2-13 Server Applicatios Actig as Cliet Applicatios... 2-14 Usig Java2 Applets... 2-14 3. Creatig ActiveX Cliet Applicatios Summary of the Developmet Process for ActiveX Cliet Applicatios... 3-2 The BEA Applicatio Builder... 3-3 Step 1: Loadig the Automatio Evirometal Objects ito the Iterface Repository... 3-3 Step 2: Loadig the CORBA Iterfaces ito the Iterface Repository... 3-4 Step 3: Startig the Iterface Repository Server Applicatio... 3-5 Step 4: Creatig ActiveX Bidigs for the CORBA Iterfaces... 3-6 Step 5: Loadig the Type Library for the ActiveX Bidigs... 3-7 Step 6: Writig the ActiveX Cliet Applicatio... 3-7 Icludig Declaratios for the Automatio Evirometal Objects, Factories, ad ActiveX Views of CORBA Objects... 3-8 Establishig Commuicatio with the BEA Tuxedo Domai... 3-8 Obtaiig Refereces to the FactoryFider Object... 3-9 iv Creatig CORBA Cliet Applicatios

Usig a Factory to Get a ActiveX View... 3-10 Ivokig Operatios o the ActiveX View... 3-11 Step 7: Deployig the ActiveX Cliet Applicatio... 3-11 4. Usig the Dyamic Ivocatio Iterface Whe to Use DII... 4-2 DII Cocepts... 4-3 Request Objects... 4-3 Optios for Sedig Requests... 4-4 Optios for Receivig the Results of Requests... 4-5 Summary of the Developmet Process for DII... 4-6 Step 1: Loadig the CORBA Iterfaces ito the Iterface Repository... 4-7 Step 2: Obtaiig the Object Referece for the CORBA Object... 4-8 Step 3: Creatig a Request Object... 4-8 Usig the CORBA::Object::_request Member Fuctio... 4-8 Usig the CORBA::Object::create_request Member Fuctio... 4-9 Settig Argumets for the Request Object... 4-9 Settig Iput ad Output Argumets with the CORBA::NamedValue Member Fuctio... 4-9 Example of Usig CORBA::Object::create_request Member Fuctio... 4-10 Step 4: Sedig a DII Request ad Retrievig the Results... 4-11 Sychroous Requests... 4-11 Deferred Sychroous Requests... 4-11 Oeway Requests... 4-12 Multiple Requests... 4-12 Step 5: Deletig the Request... 4-16 Step 6: Usig the Iterface Repository with DII... 4-16 5. Hadlig Exceptios CORBA Exceptio Hadlig Cocepts... 5-1 CORBA System Exceptios... 5-1 CORBA C++ Cliet Applicatios... 5-3 Hadlig System Exceptios... 5-5 User Exceptios... 5-5 CORBA Java Cliet Applicatios... 5-6 Creatig CORBA Cliet Applicatios v

Idex System Exceptios... 5-7 User Exceptios... 5-8 ActiveX Cliet Applicatios... 5-9 vi Creatig CORBA Cliet Applicatios

About This Documet This documet describes how to create CORBA C++, CORBA Java, ad ActiveX cliet applicatios with the CORBA eviromet i the BEA Tuxedo product. This documet itroduces importat product cocepts, provides step-by-step istructios for creatig cliet applicatios, ad icludes code examples to illustrate the developmet process. This documet icludes the followig topics: Chapter 1, CORBA Cliet Applicatio Developmet Cocepts, itroduces the cocepts you eed to kow to develop CORBA cliet applicatios usig the BEA Tuxedo software. Chapter 2, Creatig CORBA Cliet Applicatios, provides istructios for creatig CORBA C++ ad CORBA Java cliet applicatios. Chapter 3, Creatig ActiveX Cliet Applicatios, provides istructios for creatig ActiveX cliet applicatios. Chapter 4, Usig the Dyamic Ivocatio Iterface, explais how to use the Dyamic Ivocatio Iterface (DII) from CORBA C++ ad CORBA Java cliet applicatios. Chapter 5, Hadlig Exceptios, explais how CORBA C++, CORBA Java, ad ActiveX cliet applicatios hadle CORBA exceptios. What You Need to Kow This documet is iteded for programmers who wat to develop CORBA cliet applicatios usig the BEA Tuxedo software. Creatig CORBA Cliet Applicatios vii

e-docs Web Site The BEA Tuxedo product documetatio is available o the BEA Systems, Ic. corporate Web site. From the BEA Home page, click the Product Documetatio butto or go directly to the e-docs Product Documetatio page at http://e-docs.bea.com. How to Prit the Documet You ca prit a copy of this documet from a Web browser, oe file at a time, by usig the File >Prit optio o your Web browser. A PDF versio of this documet is available o the BEA Tuxedo documetatio Home page o the e-docs Web site (ad also o the documetatio CD). You ca ope the PDF i Adobe Acrobat Reader ad prit the etire documet (or a portio of it) i book format. To access the PDFs, ope the BEA Tuxedo documetatio Home page, click the PDF Files butto, ad select the documet you wat to prit. If you do ot have Adobe Acrobat Reader istalled, you ca dowload it for free from the Adobe Web site at http://www.adobe.com/. Related Iformatio For more iformatio about CORBA, BEA Tuxedo, distributed object computig, trasactio processig, C++ programmig, ad Java programmig, see the CORBA Bibliography i the BEA Tuxedo olie documetatio. viii Creatig CORBA Cliet Applicatios

Documetatio Covetios Cotact Us! Your feedback o the BEA Tuxedo documetatio is importat to us. Sed us e-mail at docsupport@bea.com if you have questios or commets. Your commets will be reviewed directly by the BEA professioals who create ad update the BEA Tuxedo documetatio. I your e-mail message, please idicate that you are usig the documetatio for BEA Tuxedo release 8.0. If you have ay questios about this versio of BEA Tuxedo, or if you have problems istallig ad ruig BEA Tuxedo, cotact BEA Customer Support through BEA WebSUPPORT at www.bea.com. You ca also cotact Customer Support by usig the cotact iformatio provided o the Customer Support Card, which is icluded i the product package. Whe cotactig Customer Support, be prepared to provide the followig iformatio: Your ame, e-mail address, phoe umber, ad fax umber Your compay ame ad compay address Your machie type ad authorizatio codes The ame ad versio of the product you are usig A descriptio of the problem ad the cotet of pertiet error messages Documetatio Covetios The followig documetatio covetios are used throughout this documet. Covetio boldface text Ctrl+Tab Item Idicates terms defied i the glossary. Idicates that you must press two or more keys simultaeously. Creatig CORBA Cliet Applicatios ix

Covetio italics moospace text moospace boldface text moospace italic text UPPERCASE TEXT Item Idicates emphasis or book titles. Idicates code samples, commads ad their optios, data structures ad their members, data types, directories, ad fileames ad their extesios. Moospace text also idicates text that you must eter from the keyboard. Examples: #iclude <iostream.h> void mai ( ) the poiter psz chmod u+w * \tux\data\ap.doc tux.doc BITMAP float Idetifies sigificat words i code. Example: void commit ( ) Idetifies variables i code. Example: Strig expr Idicates device ames, eviromet variables, ad logical operators. Examples: LPT1 SIGNON OR { } Idicates a set of choices i a sytax lie. The braces themselves should ever be typed. [ ] Idicates optioal items i a sytax lie. The brackets themselves should ever be typed. Example: buildobjcliet [-v] [-o ame ] [-f file-list]... [-l file-list]... x Creatig CORBA Cliet Applicatios

Documetatio Covetios Covetio Item Separates mutually exclusive choices i a sytax lie. The symbol itself should ever be typed.... Idicates oe of the followig i a commad lie: That a argumet ca be repeated several times i a commad lie That the statemet omits additioal optioal argumets That you ca eter additioal parameters, values, or other iformatio The ellipsis itself should ever be typed. Example: buildobjcliet [-v] [-o ame ] [-f file-list]... [-l file-list]...... Idicates the omissio of items from a code example or from a sytax lie. The vertical ellipsis itself should ever be typed. Creatig CORBA Cliet Applicatios xi

xii Creatig CORBA Cliet Applicatios

CHAPTER 1 CORBA Cliet Applicatio Developmet Cocepts This topic reviews the types of cliet applicatios supported by the CORBA eviromet i the BEA Tuxedo product ad itroduces the cocepts that you eed to uderstad before you develop CORBA cliet applicatios. This topic icludes the followig sectios: Overview of Cliet Applicatios OMG IDL Static ad Dyamic Ivocatio Cliet Stubs Iterface Repository Domais Evirometal Objects Cocepts for ActiveX Cliet Applicatios Creatig CORBA Cliet Applicatios 1-1

1 CORBA Cliet Applicatio Developmet Cocepts Overview of Cliet Applicatios The BEA Tuxedo software supports the followig types of cliet applicatios: CORBA C++ This type of cliet applicatio uses C++ evirometal objects to access the CORBA objects i a BEA Tuxedo domai ad the CORBA C++ Object Request Broker (ORB) to process requests to CORBA objects. Use the BEA Tuxedo developmet commads to build CORBA C++ cliet applicatios.corba C++ cliet applicatios ow support object by value ad the CORBA Iteroperable Namig Service (INS). CORBA Java This type of cliet applicatio uses the Java evirometal objects to access CORBA objects i a BEA Tuxedo domai. However, these cliet applicatios use a ORB product other tha the BEA Tuxedo CORBA ORB to process requests to CORBA objects. CORBA Java cliet applicatios are built usig the ORB product s Java developmet tools. The BEA Tuxedo software supports iteroperability with the Su Java Developmet Kit (JDK) Java cliet. Note: ActiveX See Istallig the BEA Tuxedo System for the specific versios of supported software. This type of cliet applicatio uses the Automatio evirometal objects to access CORBA objects i a BEA Tuxedo domai, ad the BEA ActiveX Cliet to process requests to CORBA objects. Use the Applicatio Builder to select the CORBA iterfaces that are available to ActiveX cliet applicatios, to create ActiveX views of the CORBA iterfaces, ad to create packages for deployig ActiveX views of CORBA iterfaces to cliet machies. These cliet applicatios are built usig a Automatio developmet tool such as Visual Basic or PowerBuilder. 1-2 Creatig CORBA Cliet Applicatios

OMG IDL OMG IDL With ay distributed applicatio, the cliet/server applicatio eeds some basic iformatio to commuicate. For example, the CORBA cliet applicatio eeds to kow which operatios it ca request, ad the argumets to the operatios. You use the Object Maagemet Group (OMG) Iterface Defiitio Laguage (IDL) to describe available CORBA iterfaces to cliet applicatios. A iterface defiitio writte i OMG IDL completely defies the CORBA iterface ad fully specifies each operatio s argumets. OMG IDL is a purely declarative laguage. This meas that it cotais o implemetatio details. Operatios specified i OMG IDL ca be writte i ad ivoked from ay laguage that provides CORBA bidigs. C++ ad Java are two of the supported laguages. Geerally, the applicatio desiger provides the OMG IDL files for the available CORBA iterfaces ad operatios to the programmer who creates the cliet applicatios. OMG IDL-to-C++ Mappig The BEA Tuxedo software coforms to The Commo Object Request Broker:Architecture ad Specificatio, Versio 2.3. For complete iformatio about the OMG IDL-to-C++ mappig, see The Commo Object Request Broker:Architecture ad Specificatio, Versio 2.3. OMG IDL-to-Java Mappig The BEA Tuxedo software coforms to The Commo Object Request Broker:Architecture ad Specificatio, Versio 2.2. For complete iformatio about the OMG IDL-to-Java mappig, see The Commo Object Request Broker:Architecture ad Specificatio, Versio 2.2. Creatig CORBA Cliet Applicatios 1-3

1 CORBA Cliet Applicatio Developmet Cocepts OMG IDL-to-COM Mappig The BEA Tuxedo software coforms to the OMG IDL to COM mappig as defied i the Commo Object Request Broker:Architecture ad Specificatio, Versio 2.3. For complete iformatio about the OMG IDL to COM mappig, see The Commo Object Request Broker:Architecture ad Specificatio, Versio 2.3. Static ad Dyamic Ivocatio The CORBA ORB i the BEA Tuxedo product supports two types of cliet/server ivocatios: static ad dyamic. I both cases, the CORBA cliet applicatio performs a request by gaiig access to a referece for a CORBA object ad ivokig the operatio that satisfies the request. The CORBA server applicatio caot tell the differece betwee static ad dyamic ivocatios. Whe usig static ivocatio, the CORBA cliet applicatio ivokes operatios directly o the cliet stubs. Static ivocatio is the easiest, most commo type of ivocatio. The stubs are geerated by the IDL compiler. Static ivocatio is recommeded for applicatios that kow at compile time the particulars of the operatios they eed to ivoke ad ca process withi the sychroous ature of the ivocatio. Figure 1-1 illustrates static ivocatio. 1-4 Creatig CORBA Cliet Applicatios

Static ad Dyamic Ivocatio Figure 1-1 Static Ivocatio OMG IDL Cliet Applicatio Static Ivocatio Server Applicatio IDL Compiler Cliet Stub Server Skeleto Object Request Broker Request While dyamic ivocatio is more complicated, it eables your CORBA cliet applicatio to ivoke operatios o ay CORBA object without havig to kow the CORBA object s iterfaces at compile time. Figure 1-2 illustrates dyamic ivocatio. Creatig CORBA Cliet Applicatios 1-5

1 CORBA Cliet Applicatio Developmet Cocepts Figure 1-2 Dyamic Ivocatio OMG IDL Server Applicatio Iterface Repository Cliet Applicatio Dyamic Ivocatio Server Skeleto Object Request Broker Request Whe usig dyamic ivocatio, the CORBA cliet applicatio ca dyamically build operatio requests for a CORBA object iterface that has bee stored i the Iterface Repository. CORBA server applicatios do ot require ay special desig to be able to receive ad hadle dyamic ivocatio requests. Dyamic ivocatio is geerally used whe the CORBA cliet applicatio requires deferred sychroous commuicatio, or by dyamic cliet applicatios whe the ature of the iteractio is udefied. For more iformatio about usig dyamic ivocatio, see Chapter 4, Usig the Dyamic Ivocatio Iterface. Cliet Stubs Cliet stubs provide the programmig iterface to operatios that a CORBA object ca perform. A cliet stub is a local proxy for the CORBA object. Cliet stubs provide a mechaism for performig a sychroous ivocatio o a object referece for a 1-6 Creatig CORBA Cliet Applicatios

Iterface Repository CORBA object. The CORBA cliet applicatio does ot eed special code to deal with the CORBA object or its argumets; the cliet applicatio simply treats the stub as a local object. A CORBA cliet applicatio must have a stub for each iterface it plas to use. You use the idl commad (or your Java ORB product s equivalet commad) to geerate a cliet stub from the OMG IDL defiitio of the CORBA iterface. The commad geerates a stub file ad a header file that describe everythig that you eed if you wat to use the cliet stub from a programmig laguage, such as C++ or Java. You simply ivoke a method from withi your CORBA cliet applicatio to request a operatio o the CORBA object. Iterface Repository The Iterface Repository cotais descriptios of a CORBA object s iterfaces ad operatios. The iformatio stored i the Iterface Repository is equivalet to the iformatio defied i a OMG IDL file, but the iformatio is accessible programmatically at ru time. CORBA cliet applicatios use the Iterface Repository for the followig reasos: CORBA cliet applicatios that use dyamic ivocatio use the Iterface Repository to lear about a CORBA object s iterfaces, ad to ivoke operatios o the object. ActiveX cliet applicatios are ot aware that they are usig the Iterface Repository. A ActiveX cliet applicatio uses CORBA operatios to obtai iformatio about CORBA objects from the Iterface Repository. CORBA cliet applicatios that use static ivocatio do ot access the Iterface Repository at ru time. The iformatio about the CORBA object s iterfaces is icluded i the cliet stub. You use the followig BEA Tuxedo developmet commads to maage the Iterface Repository: The idl2ir commad populates the Iterface Repository with CORBA iterfaces. This commad creates a Iterface Repository if a Iterface Repository does ot exist. Also use this commad to update the CORBA iterfaces i the Iterface Repository. Creatig CORBA Cliet Applicatios 1-7

1 CORBA Cliet Applicatio Developmet Cocepts The ir2idl commad creates a OMG IDL file from the cotets of the Iterface Repository. The irdel commad deletes CORBA iterfaces from the Iterface Repository. For a descriptio of the developmet commads for the Iterface Repository, see the BEA Tuxedo Commad Referece. Domais A domai is a way of groupig objects ad services together as a maagemet etity. A BEA Tuxedo domai has at least oe IIOP Listeer/Hadler ad is idetified by a ame. Oe CORBA cliet applicatio ca coect to multiple BEA Tuxedo domais usig differet Bootstrap objects. For each BEA Tuxedo domai, a CORBA cliet applicatio ca get objects which correspod to the services (for example, trasactios, security, amig, evets) offered withi the BEA Tuxedo domai. For a descriptio of the Bootstrap object ad the CORBA services available i a BEA Tuxedo domai, see Evirometal Objects o page 1-9. Note: Oly oe evirometal object per service ca exist at the same time ad the evirometal objects must be associated with the same Bootstrap object. Figure 1-3 illustrates how a BEA Tuxedo domai works. 1-8 Creatig CORBA Cliet Applicatios

Evirometal Objects Figure 1-3 How a BEA Tuxedo Domai Works Evirometal Objects The BEA Tuxedo software provides a set of evirometal objects that set up commuicatio betwee CORBA cliet ad server applicatios i a BEA Tuxedo domai ad provide access to the CORBA services provided by the domai. The BEA Tuxedo software provides the followig evirometal objects: Bootstrap This object establishes commuicatio betwee a CORBA cliet applicatio ad a BEA Tuxedo domai. It also obtais object refereces for the other evirometal objects i the BEA Tuxedo domai. Creatig CORBA Cliet Applicatios 1-9

1 CORBA Cliet Applicatio Developmet Cocepts Note: Third-party cliet ORBs ca also use the CORBA Iteroperable Namig Service (INS) to access the services withi a BEA Tuxedo domai. For more iformatio, see the CORBA Bootstrap Object Programmig Referece topic i the CORBA Programmig Referece. FactoryFider This CORBA object locates a factory, which i tur ca create object refereces for CORBA objects. IterfaceRepository This CORBA object cotais iterface defiitios for all the available CORBA iterfaces ad the factories used to create object refereces to the CORBA iterfaces. SecurityCurret This BEA-proprietary object is used to log a CORBA cliet applicatio ito a BEA Tuxedo domai with the proper security credetials. The BEA Tuxedo software provides a implemetatio of the CORBAservices Security Service. TrasactioCurret This BEA-proprietary object allows a CORBA cliet applicatio to participate i a trasactio. The TrasactioCurret object provides a implemetatio of the CORBAservices Object Trasactio Service (OTS). NotificatioService This CORBA object allows a CORBA cliet applicatio to obtai a referece to the evet chael factory (CosNotifyChaelAdmi::EvetChaelFactory) i the CosNotificatio Service. I tur, the EvetChaelFactory is used to locate the Notificatio Service chael. I additio, a Tobj_SimpleEvetsService object is provided. This BEA-proprietary object allows a CORBA cliet applicatio to obtai a referece to a BEA-proprietary evets iterface. The evets iterface passes stadard, structured evets as defied by the CosNotificatio Service, however, the API has bee simplified for easier use. 1-10 Creatig CORBA Cliet Applicatios

Evirometal Objects NameService This CORBA object allows a CORBA cliet applicatio to use a amespace to resolve object refereces. The BEA Tuxedo software provides a implemetatio of the CORBAservices Name Service. The BEA Tuxedo software provides evirometal objects for the followig programmig eviromets: C++ Java Automatio Bootstrap Object A CORBA cliet applicatio creates a Bootstrap object which defies the address of a IIOP Listeer/Hadler. The IIOP Listeer/Hadler is the access poit to a BEA Tuxedo domai ad the CORBA services provided by the domai. A list of IIOP Listeer/Hadlers ca be supplied either as a parameter or via the TOBJADDR evirometal variable or a Java property. A sigle IIOP Listeer/Hadler is specified as follows: //host:port For example, //myserver:4000 Oce the Bootstrap object is istatiated, the resolve_iitial_refereces method is ivoked, passig i a strig ID, to obtai a referece to a available object. The valid values for the strig ID are FactoryFider, Iterface Repository, SecurityCurret, TrasactioCurret, NotificatioService, TObj_SimpleEvetsService, ad NameService. Figure 1-4 illustrates how the Bootstrap object works i a BEA Tuxedo domai. Creatig CORBA Cliet Applicatios 1-11

1 CORBA Cliet Applicatio Developmet Cocepts Figure 1-4 How the Bootstrap Object Works Third-party cliet ORBs ca also use the CORBA Iteroperable Namig Service (INS) mechaism to gai access to a BEA Tuxedo domai ad its services. The Iteroperable Namig Service allows third-party cliet ORBs to use their ORB s resolve_iitial_refereces() fuctio to access CORBA services provided by the BEA Tuxedo domai ad use stubs geerated from stadard OMG IDL to act o the istaces retured from the domai. For more iformatio about usig the Iteroperable Namig Service, see the CORBA Programmig Referece. 1-12 Creatig CORBA Cliet Applicatios

Evirometal Objects Factories ad the FactoryFider Object CORBA cliet applicatios get object refereces to CORBA objects from a factory. A factory is ay CORBA object that returs a object referece to aother CORBA object ad registers itself with the FactoryFider object. To use a CORBA object, the CORBA cliet applicatio must be able to locate the factory that creates a object referece for the CORBA object. The BEA Tuxedo software offers the FactoryFider object for this purpose. The factories available to CORBA cliet applicatios are those that are registered with the FactoryFider object by CORBA server applicatios at startup. The CORBA cliet applicatio uses the followig sequece of steps to obtai a referece to a CORBA object: 1. Oce the Bootstrap object is created, the resolve_iitial_refereces method is ivoked to obtai the referece to the FactoryFider object. 2. CORBA cliet applicatios query the FactoryFider object for object refereces to the desired factory. 3. CORBA cliet applicatios the call the factory to obtai a object referece to the CORBA object. Figure 1-5 illustrates the CORBA cliet applicatio iteractio with the FactoryFider object. Creatig CORBA Cliet Applicatios 1-13

1 CORBA Cliet Applicatio Developmet Cocepts Figure 1-5 How Cliet Applicatios Use the FactoryFider Object Namig Covetios ad BEA Tuxedo Extesios to the FactoryFider Object The factories available to CORBA cliet applicatios are those that are registered with the FactoryFider object by the CORBA server applicatios at startup. Factories are registered usig a key cosistig of the followig fields: The Iterface Repository ID of the factory s iterface A object referece to the factory The FactoryFider object used by the BEA Tuxedo software is defied i the CORBAservices Life Cycle Service. The BEA Tuxedo software implemets extesios to the COS::LifeCycle::FactoryFider iterface that make it easier for cliet applicatios to locate a factory usig the FactoryFider object. 1-14 Creatig CORBA Cliet Applicatios

Evirometal Objects The CORBAservices Life Cycle Service specifies the use of ames as defied i the CORBAservices Namig Service to locate factories with the COS::LifeCycle::FactoryFider iterface. These ames cosist of a sequece of NameCompoet structures, which cosist of ID ad kid fields. The use of CORBA ames to locate factories is cumbersome for cliet applicatios; it ivolves may calls to build the appropriate ame structures ad assemble the CORBA Name Service ame that must be passed to the fid_factories method of the COS::LifeCycle::FactoryFider iterface. Also, sice the method ca retur more tha oe factory, cliet applicatios must maage the selectio of a appropriate factory ad the disposal of uwated object refereces. The FactoryFider object is desiged to make it easier for CORBA cliet applicatios to locate factories by extedig the iterface with simpler method calls. The extesios are iteded to provide the followig simplificatios for the CORBA cliet applicatio: Let the CORBA cliet applicatio locate factories by ID, usig a simple strig parameter for the ID field. This reduces the work eeded by the CORBA cliet applicatio to build ame structures. Permit the FactoryFider object to implemet a load balacig scheme by choosig from a pool of available factories. Provide methods that retur oe object referece to a factory, istead of a sequece of object refereces. This elimiates the eed for CORBA cliet applicatios to provide code to hadle the selectio of a sigle factory from a sequece, ad the dispose of the ueeded refereces. The most straightforward applicatio desig ca be achieved by usig the Tobj::FactoryFider::fid_oe_factory_by_id method i CORBA cliet applicatios. This method accepts a simple strig for factory ID as iput ad returs oe factory to the CORBA cliet applicatio. The CORBA cliet applicatio is freed from the ecessity of maipulatig ame compoets ad selectig amog may factories. To use the Tobj::FactoryFider::fid_oe_factory_by_id method, the applicatio desiger must establish a amig covetio for factories that CORBA cliet applicatios ca use to easily locate factories for specific CORBA object iterfaces. Ideally, this covetio should establish some memoic types for factories that supply object refereces for certai types of CORBA object iterfaces. Factories are the registered usig these covetios. For example, a factory that returs a Creatig CORBA Cliet Applicatios 1-15

1 CORBA Cliet Applicatio Developmet Cocepts object referece for Studet objects might be called StudetFactory. For more iformatio about registerig factories with the FactoryFider object, see Creatig CORBA Server Applicatios. It is recommeded that you either use the actual iterface ID of the factory i the OMG IDL file, or specify the factory ID as a costat i the OMG IDL file. This techique esures amig cosistecy betwee the CORBA cliet applicatio ad the CORBA server applicatio. IterfaceRepository Object The IterfaceRepository object returs iformatio about the Iterface Repository i a BEA Tuxedo domai. The IterfaceRepository object is based o the CORBA defiitio of a Iterface Repository. It offers the proper set of CORBA iterfaces as defied by the Commo Request Broker Architecture ad Specificatio Versio 2.2. CORBA cliet applicatios that use the Dyamic Ivocatio Iterface (DII) eed to access the Iterface Repository programmatically. The exact steps take to access the Iterface Repository deped o whether the CORBA cliet applicatio is seekig iformatio about a specific CORBA iterface or browsig the Iterface Repository to fid a iterface. I either case, the CORBA cliet applicatio ca oly read to the Iterface Repository, it caot write to the Iterface Repository. Before a CORBA cliet applicatio usig DII ca browse the Iterface Repository i a BEA Tuxedo domai, the CORBA cliet applicatio eeds to obtai a object referece for the IterfaceRepository object i that domai. CORBA cliet applicatios usig DII use the Bootstrap object to obtai the object referece. ActiveX cliet applicatios also use the Iterface Repository. Like CORBA cliet applicatios, ActiveX cliet applicatios use the Bootstrap object to obtai a referece to the IterfaceRepository object. For iformatio about usig the IterfaceRepository object i CORBA cliet applicatios that use DII, see Chapter 4, Usig the Dyamic Ivocatio Iterface. For a descriptio of the IterfaceRepository object, see the CORBA Programmig Referece. 1-16 Creatig CORBA Cliet Applicatios

Evirometal Objects SecurityCurret Object CORBA C++, CORBA Java, ad ActiveX cliet applicatios use security to autheticate themselves to the BEA Tuxedo domai. Autheticatio is the process of verifyig the idetity of a cliet applicatio. By eterig the correct logo iformatio, the cliet applicatio autheticates itself to the BEA Tuxedo domai. The BEA Tuxedo software uses autheticatio as defied i the CORBAservices Security Service ad provides extesios for ease of use. CORBA cliet applicatios use the SecurityCurret object to log o to the BEA Tuxedo domai ad pass security credetials to the domai. The SecurityCurret object is a BEA Tuxedo implemetatio of the CORBAservices Security Service. The CORBA security model i the BEA Tuxedo product is based o autheticatio. You use the SecurityCurret object to specify the appropriate level of security for the domai. The followig levels of autheticatio are provided: TOBJ_NOAUTH No autheticatio is eeded; however, the CORBA cliet applicatio may still autheticate itself, ad may specify a userame ad a cliet applicatio ame, but o password. TOBJ_SYSAUTH The CORBA cliet applicatio must autheticate itself to the BEA Tuxedo domai ad must specify a userame, cliet applicatio ame, ad applicatio password. TOBJ_APPAUTH I additio to the TOBJ_SYSAUTH iformatio, the CORBA cliet applicatio must provide applicatio-specific iformatio. If the default BEA Tuxedo autheticatio service is used i the applicatio cofiguratio, the CORBA cliet applicatio must provide a user password; otherwise, the CORBA cliet applicatio provides autheticatio data that is iterpreted by the custom autheticatio service i the applicatio. Note: If a CORBA cliet applicatio is ot autheticated ad the security level is TOBJ_NOAUTH, the IIOP Listeer/Hadler of the BEA Tuxedo domai registers the CORBA cliet applicatio with the userame ad cliet applicatio ame set to the IIOP Listeer/Hadler. Creatig CORBA Cliet Applicatios 1-17

1 CORBA Cliet Applicatio Developmet Cocepts I the BEA Tuxedo software, oly the PricipalAutheticator ad Credetials properties o the SecurityCurret object are supported. For iformatio about usig the SecurityCurret object i cliet applicatios, see Usig Security i CORBA Applicatios. For a descriptio of the SecurityLevel1::Curret ad SecurityLevel2::Curret iterfaces, refer to the CORBA Programmig Referece. TrasactioCurret Object The TrasactioCurret object is a BEA Tuxedo implemetatio of the CORBAservices Object Trasactio Service. The TrasactioCurret object maitais a trasactioal cotext for the curret sessio betwee the CORBA cliet applicatio ad the CORBA server applicatio. Usig the TrasactioCurret object, the CORBA cliet applicatio ca perform trasactioal operatios, such as iitiatig ad termiatig a trasactio ad gettig the status of a trasactio. Trasactios are used o a per-iterface basis. Durig desig, the applicatio desiger decides which iterfaces withi a CORBA applicatio will hadle trasactios. A trasactio policy for each iterface is the defied i a Implemetatio Cofiguratio File (ICF). The trasactio policies are: Never The iterface is ot trasactioal. Objects created for this iterface ca ever be ivolved i a trasactio. The BEA Tuxedo software geerates a exceptio (INVALID_TRANSACTION) if a iterface with this policy is ivolved i a trasactio. Optioal The iterface may be trasactioal. Objects ca be ivolved i a trasactio if the request is trasactioal. Always The iterface must always be part of a trasactio. If the iterface is ot part of a trasactio, a trasactio will be automatically started by the TP framework. 1-18 Creatig CORBA Cliet Applicatios

Evirometal Objects Igore The iterface is ot trasactioal. The iterface ca be icluded i a trasactio, however, the AUTOTRAN policy specified for this iterface i the UBBCONFIG file is igored. For iformatio about usig the TrasactioCurret object i CORBA cliet applicatios, see Usig CORBA Trasactios. For a descriptio of the TrasactioCurret object, see the CORBA Programmig Referece. NotificatioService ad Tobj_SimpleEvetsService Objects The NotificatioService ad Tobj_SimpleEvetsService objects provide access to a CORBA evet service. The evet service i the CORBA eviromet of the BEA Tuxedo product offers similar capabilities to those of the EvetBroker i the ATMI eviromet. However, the CORBA evet service offers a programmig model ad iterface that is atural for CORBA programmers. The evet service receives evet postig messages, filters them, ad distributes them to subscribers. A poster is a CORBA applicatio that detects whe a evet of iterest has occurred ad reports (posts) it to the evet service. A subscriber is a CORBA applicatio that requests some otificatio actio to be take whe a evet of iterest is posted. The CORBA evet service provides two sets of iterfaces: The NotificatioService object provides a miimal subset of the CORBA-based Notificatio Service iterfaces (referred to as the CosNotificatio Service iterface). The Tobj_SimpleEvetsService object provides BEA-proprietary iterfaces desiged to be easy to use. Both sets of iterfaces pass stadard, structured evets as defied by the CORBA Notificatio Service specificatio. The two sets of iterfaces are compatible with each other; that is, evets posted usig the NotificatioService iterfaces ca be subscribed to by the Tobj_SimpleEvetsService iterfaces ad vice versa. For iformatio about usig the NotificatioServer ad Tobj_SimpleEvetsService objects, see Usig the CORBA Notificatio Service. Creatig CORBA Cliet Applicatios 1-19

1 CORBA Cliet Applicatio Developmet Cocepts NameService Object The NameService object provides access to a CORBA Name Service which allows CORBA server applicatios to advertise object refereces usig logical ames. CORBA cliet applicatios ca the locate a object by askig the CORBA Name Service to look up the ame. The CORBA Name Service provides: A implemetatio of the Object Maagemet Group (OMG) Iteroperable Name Service (INS) specificatio. Applicatio programmig iterfaces (APIs) for mappig object refereces ito a hierarchical amig structure (referred to as a amespace). Commads for displayig bidigs ad for bidig ad ubidig amig cotext objects ad applicatio objects ito the amespace. For iformatio about usig the NameService object i a CORBA cliet applicatio, see Usig the CORBA Name Service. Cocepts for ActiveX Cliet Applicatios The followig sectios describe cocepts that are specific to ActiveX cliet applicatios. What Is ActiveX? ActiveX is a set of techologies from Microsoft that eables software compoets to iteract with oe aother i a etworked eviromet, regardless of the laguage i which the compoets were created. ActiveX is built o the Compoet Object Model (COM) ad itegrates with Object Likig ad Embeddig (OLE). OLE provides a architecture for documet embeddig. Automatio is the part of COM that allows applicatios such as Visual Basic, Delphi, ad PowerBuilder to maipulate Automatio objects, ActiveX cotrols, ad ActiveX documets. 1-20 Creatig CORBA Cliet Applicatios

Cocepts for ActiveX Cliet Applicatios The BEA ActiveX Cliet provides iteroperability betwee the BEA Tuxedo ad COM object systems. The ActiveX Cliet trasforms the iterfaces of CORBA objects i a BEA Tuxedo domai ito methods o Automatio objects. Views ad Bidigs ActiveX cliet applicatios use views of CORBA iterfaces. Views represet the CORBA iterfaces i a BEA Tuxedo domai locally as Automatio objects. To use a ActiveX view of a CORBA object (referred to as a ActiveX view), you eed to create a bidig for ActiveX. The bidig describes the iterface of a CORBA object to ActiveX. The iterfaces of the CORBA objects are loaded ito the Iterface Repository. You the use the BEA Applicatio Builder to create Automatio bidigs for the iterfaces. The Applicatio Builder is a developmet tool that you use alog with a cliet developmet tool (such as Visual Basic) to select which CORBA objects i a BEA Tuxedo domai you wat your ActiveX cliet applicatio to iteract with. For a descriptio of the Applicatio Builder ad how it works, see the olie help that is itegrated ito the Applicatio Builder graphical user iterface (GUI). The combiatio of the ActiveX cliet applicatio ad the geerated bidig creates the ActiveX view of the object. For a complete descriptio of creatig ad usig ActiveX cliet applicatios, see Creatig ActiveX Cliet Applicatios o page 3-1. Figure 1-6 illustrates how the ActiveX Cliet works. Creatig CORBA Cliet Applicatios 1-21

1 CORBA Cliet Applicatio Developmet Cocepts Figure 1-6 How the ActiveX Cliet Works CORBAIterface.idl Iterface Repository Applicatio Builder DICORBAIterface.tlb (bidig) ActiveX Cliet Applicatio Namig Covetios for ActiveX Views Namig covetios describe a algorithm for mappig CORBA iterfaces to ActiveX to avoid type ad variable ame coflicts. Namig covetios also idicate how to use a give object. The ames of all ActiveX methods begi with DI. The ActiveX Cliet observes this amig covetio whe it creates Automatio bidigs for CORBA iterfaces. If a CORBA iterface has the ame Accout, the Automatio bidig for that iterface has the ame DIAccout. CORBA iterface ames are ofte scoped withi ested levels kow as modules; however, i ActiveX, there is o scopig. To avoid ame coflicts, the ActiveX Cliet exposes a CORBA iterface ito ActiveX with the ame of the differet scopes prepeded to the ame of the iterface. For example, a CORBA iterface amed Accout is defied i the OMG IDL file as: module Uiversity { module Studet { 1-22 Creatig CORBA Cliet Applicatios

Cocepts for ActiveX Cliet Applicatios iterface Accout {//Operatios ad attributes of the Accout iterface }; }; }; I CORBA, this iterface is amed Uiversity::Studet::Accout. The ActiveX Cliet traslates this ame to DIUiversity_Studet_Accout for ActiveX. Creatig CORBA Cliet Applicatios 1-23

1 CORBA Cliet Applicatio Developmet Cocepts 1-24 Creatig CORBA Cliet Applicatios

CHAPTER 2 Creatig CORBA Cliet Applicatios This topic icludes the followig sectios: Summary of the Developmet Process for CORBA C++ Cliet Applicatios Summary of the Developmet Process for CORBA Java Cliet Applicatios Step 1: Obtaiig the OMG IDL File Step 2: Selectig the Ivocatio Type Step 3: Compilig the OMG IDL File Step 4: Writig the CORBA Cliet Applicatio Step 5: Buildig the CORBA Cliet Applicatio Server Applicatios Actig as Cliet Applicatios Usig Java2 Applets Creatig CORBA Cliet Applicatios 2-1

2 Creatig CORBA Cliet Applicatios Summary of the Developmet Process for CORBA C++ Cliet Applicatios The steps for creatig a CORBA C++ cliet applicatio are as follows: Step Descriptio 1 Obtai the OMG IDL file for the CORBA iterfaces used by the CORBA C++ cliet applicatio. 2 Select the ivocatio type. 3 Use the IDL compiler to compile the OMG IDL file. The cliet stubs are geerated as a result of compilig the OMG IDL. 4 Write the CORBA C++ cliet applicatio. This topic describes creatig a basic cliet applicatio. 5 Build the CORBA C++ cliet applicatio. Each step i the process is explaied i detail i the followig sectios. The BEA Tuxedo developmet eviromet for CORBA C++ cliet applicatios icludes the followig: The idl commad, which compiles the OMG IDL file ad geerates the cliet stubs required for the CORBA iterface. The buildobjcliet commad, which costructs a CORBA C++ cliet applicatio executable. The C++ evirometal objects, which provide access to CORBA objects i a BEA Tuxedo domai ad to the services provided by the CORBA objects. 2-2 Creatig CORBA Cliet Applicatios

Summary of the Developmet Process for CORBA Java Cliet Applicatios Summary of the Developmet Process for CORBA Java Cliet Applicatios The BEA Tuxedo software supports iteroperability with Su Microsystem s Java Developmet Kit (JDK) Java cliet. Note: See Istallig the BEA Tuxedo System for the specific versios of supported software The steps for creatig a CORBA Java cliet applicatio are as follows: Step Descriptio 1 Obtai the OMG IDL file for the CORBA iterfaces used by the CORBA Java cliet applicatio. 2 Select the ivocatio type. 3 Use the developmet tools provided by your CORBA Java Object Request Broker (ORB) to compile the OMG IDL file ad geerate cliet stubs. 4 Write the CORBA Java cliet applicatio. This topic describes creatig a basic cliet applicatio. 5 Build the CORBA Java cliet applicatio. Each step i the process is explaied i detail i the followig sectios. You eed to use the developmet tools provided by your CORBA Java ORB product to compile the OMG IDL file, geerate the cliet stubs, ad build the CORBA Java cliet applicatio executable. You use the Java evirometal objects, which provide access to CORBA objects i a BEA Tuxedo domai ad to the services provided by the CORBA objects. Creatig CORBA Cliet Applicatios 2-3

2 Creatig CORBA Cliet Applicatios Step 1: Obtaiig the OMG IDL File Geerally, the OMG IDL files for the available iterfaces ad operatios are provided to the cliet programmer by the applicatio desiger. This sectio cotais the OMG IDL for the Basic sample applicatio. Listig 2-1 shows the uivb.idl file, which defies the followig iterfaces: Iterface Descriptio Operatios Registrar RegistrarFactory CourseSyopsisEumerator Obtais course iformatio from the course database. Creates object refereces to the Registrar object. Gets a subset of the iformatio from the course database, ad iteratively returs portios of that subset to the CORBA cliet applicatio. get_courses_syopsis() get_courses_details() fid_registrar() get_ext_() destroy() Listig 2-1 OMG IDL File for the Basic Sample Applicatio #pragma prefix "beasys.com" module UiversityB { typedef usiged log CourseNumber; typedef sequece<coursenumber> CourseNumberList; struct CourseSyopsis { CourseNumber course_umber; strig title; }; typedef sequece<coursesyopsis> CourseSyopsisList; iterface CourseSyopsisEumerator { CourseSyopsisList get_ext_( 2-4 Creatig CORBA Cliet Applicatios

Step 1: Obtaiig the OMG IDL File }; }; i usiged log umber_to_get, out usiged log umber_remaiig void destroy(); typedef usiged short Days; cost Days MONDAY = 1; cost Days TUESDAY = 2; cost Days WEDNESDAY = 4; cost Days THURSDAY = 8; cost Days FRIDAY = 16; struct ClassSchedule { Days class_days; // bitmask of days usiged short start_hour; // whole hours i military time usiged short duratio; // miutes }; struct CourseDetails { CourseNumber course_umber; double cost; usiged short umber_of_credits; ClassSchedule class_schedule; usiged short umber_of_seats; strig title; strig professor; strig descriptio; }; typedef sequece<coursedetails> CourseDetailsList; iterface Registrar { CourseSyopsisList get_courses_syopsis( i strig search_criteria, i usiged log umber_to_get, // 0 = all out usiged log umber_remaiig, out CourseSyopsisEumerator rest ); CourseDetailsList get_courses_details(i CourseNumberList courses); iterface RegistrarFactory { Creatig CORBA Cliet Applicatios 2-5

2 Creatig CORBA Cliet Applicatios ); Registrar fid_registrar( }; }; Step 2: Selectig the Ivocatio Type Select the ivocatio type (static or dyamic) that you will use i the requests i the CORBA cliet applicatio. You ca use both types of ivocatio i a CORBA cliet applicatio. For a overview of static ad dyamic ivocatio, see Static ad Dyamic Ivocatio o page 1-4. The remaider of this topic assumes that you chose to use static ivocatio i your CORBA cliet applicatio. If you chose to use dyamic ivocatio, see Chapter 4, Usig the Dyamic Ivocatio Iterface. Step 3: Compilig the OMG IDL File Whe creatig CORBA C++ cliet applicatios, use the idl commad to compile the OMG IDL file ad geerate the files required for the iterface. The followig is the sytax of the idl commad: idl idlfileame(s) The IDL compiler geerates a cliet stub (idlfileame_c.cpp) ad a header file (idlfileame_c.h) that describe everythig you eed to have to use the cliet stub from the C++ programmig laguage. You eed to lik these files ito your CORBA cliet applicatio. 2-6 Creatig CORBA Cliet Applicatios

Step 3: Compilig the OMG IDL File I additio, the IDL compiler geerates skeletos that cotai the sigatures of the CORBA object s operatios. The geerated skeleto iformatio is placed i the idlfileame_s.cpp ad idlfileame_s.h files. Durig developmet of the CORBA cliet applicatio, it ca be useful to look at the server header files ad skeleto file. Note: Do ot modify the geerated cliet stub or the skeleto. For a complete descriptio of the idl commad ad optios, see the BEA Tuxedo Commad Referece. Whe creatig CORBA Java cliet applicatios: If you are usig JDK versio 1.2, you ca use the idltojava commad to compile the OMG IDL file. For more iformatio about the idltojava commad, see the documetatio for the JDK versio 1.2. If you are usig Netscape versio 3.0 ad Java Developmet Kit (JDK) versio 1.1.5, you eed to use that product s IDL compiler to compile the OMG IDL. The idltojava commad or the IDL compiler geerates the followig: The cliet stubs for each iterface (_iterfacestub.java). The CORBA helper class (iterfacehelper.java) ad the CORBA holder class (iterfaceholder.java) that describe everythig you eed to use the cliet stub from the Java programmig laguage. Note that each OMG IDL defied exceptio defies a exceptio class ad its helper ad holder classes. The compiled.class files must be i the CLASSPATH of your CORBA cliet applicatio. I additio, the idltojava commad or the IDL compiler geerates skeletos that cotai the sigatures of the operatios of the CORBA object. The geerated skeleto iformatio is placed i the _iterfaceimplbase file. Creatig CORBA Cliet Applicatios 2-7

2 Creatig CORBA Cliet Applicatios Step 4: Writig the CORBA Cliet Applicatio To participate i a sessio with a CORBA server applicatio, a CORBA cliet applicatio must be able to get a object referece for a CORBA object ad ivoke operatios o the object. To accomplish this, the CORBA cliet applicatio code must do the followig: 1. Iitialize the BEA Tuxedo ORB. 2. Establish commuicatio with the BEA Tuxedo domai. 3. Resolve iitial refereces to the FactoryFider object. 4. Use a factory to get a object referece for the desired CORBA object. 5. Ivoke operatios o the CORBA object. The followig sectios use portios of the cliet applicatios i the Basic sample applicatio to illustrate the steps. For iformatio about the Basic sample applicatio, see the Guide to the CORBA Uiversity Sample Applicatios. The Basic sample applicatio is located i the followig directory o the BEA Tuxedo software kit: drive:\tuxdir\samples\corba\uiversity\basic Iitializig the ORB All CORBA cliet applicatios must first iitialize the ORB. Use the followig code to iitialize the ORB from a CORBA C++ cliet applicatio: C++ CORBA::ORB_var orb=corba::orb_iit(argc, argv, ORBid); Typically, o ORBid is specified ad the default ORBid specified durig istallatio is used. However, whe a CORBA cliet applicatio is ruig o a machie that also has CORBA server applicatios ruig ad the CORBA cliet applicatio wats to 2-8 Creatig CORBA Cliet Applicatios

Step 4: Writig the CORBA Cliet Applicatio access server applicatios i aother BEA Tuxedo domai, you eed to override the default ORBid. This ca be doe by hard codig the ORBid as BEA_IIOP or by passig the ORBid i the commad lie as _ORBid BEA_IIOP. Use the followig code to iitialize the ORB from a CORBA Java cliet applicatio: Java Applicatio org.omg.corba.orb orb = org.omg.corba.orb.iit (args,props); Use the followig code to iitialize the ORB from a CORBA Java cliet applet: Java Applet org.omg.corba.orb orb = org.omg.corba.orb.iit (this,ull); where this is the ame of the Java applet Establishig Commuicatio with the BEA Tuxedo Domai The CORBA cliet applicatio creates a Bootstrap object. A list of IIOP Listeer/Hadlers ca be supplied either as a parameter, via the TOBJADDR Java property or applet property. A sigle IIOP Listeer/Hadler is specified as follows: //host:port Whe the IIOP Listerer/Hadler is provided via TOBJADDR, the secod argumet of the costructor ca be ull. The host ad port combiatio for the IIOP Listeer/Hadler is defied i the UBBCONFIG file. The host ad port combiatio that is specified for the Bootstrap object must exactly match the ISL parameter i the BEA Tuxedo domai s UBBCONFIG file. The format of the host ad port combiatio, as well as the capitalizatio, must match. If the addresses do ot match, the call to the Bootstrap object will fail ad the followig message appears i the log file: Error: Uofficial coectio from cliet at <tcp/ip address>/<portumber> For example, if the etwork address is specified as //TRIXIE::3500 i the ISL parameter i the UBBCONFIG file, specifyig either //192.12.4.6.:3500 or //trixie:3500 i the Bootstrap object will cause the coectio attempt to fail. Creatig CORBA Cliet Applicatios 2-9