Introduction to CORBA Copyright 1999 B Ramamurthy 1192022

Introduction to CORBA Copyright 1999 B. Ramamurthy 1/19/2022 B. Ramamurthy 1

Topics for Discussion z My Research Background z What is CORBA? z Object Request Broker (ORB) z Structure of a CORBA Application z Interoperability between ORBs z OMA (needed? ) z Orbix. Web z Example 1: Java Application (grid) z Example 2: Java Applet (grid) z Summary 1/19/2022 B. Ramamurthy 2

My Research Background z Major Area : Distributed Systems z Mostly experimental involving implementation. z Fall 96 - 97 : Sun Micro Systems’s Spring OS and Transarc’s DCE y. Students : David Ott and Andy Mauer z Fall 97 -Spring 99 : Iona’s Orbix. Web z Fall 99 - current : Distributed Computing Paradigms 1/19/2022 B. Ramamurthy 3

What is CORBA? z. Common Object Request Broker Architecture (CORBA) specification (/standard) defines a framework for object-oriented distributed applications. z. It is defined by a consortium of vendors under the direction of Object Management Group (OMG). 1/19/2022 B. Ramamurthy 4

What is CORBA? (contd. ) z Allows distributed programs in different languages and different platforms to interact as though they were in a single programming language on one computer. z Brings advantages of OO to distributed systems. z Allows you design a distributed application as a set of cooperating objects and to reuse existing objects. 1/19/2022 B. Ramamurthy 5

Object Request Broker (ORB) z A software component that mediates transfer of messages from a program to an object located on a remote host. z Hides underlying network communications from a programmer. z ORB allows you to create software objects whose member functions can be invoked by client programs located anywhere. z A server program contains instances of CORBA objects. 1/19/2022 B. Ramamurthy 6

Clients, severs and objects Server 0 Client CORBA Object invocation Server 1 1/19/2022 B. Ramamurthy 7

CORBA Objects and IDL z These are standard software objects implemented in any supported language including Java, C++ and Smalltalk. z Each CORBA object has a clearly defined interface specified in CORBA interface definition language (IDL). z The interface definition specifies the member functions available to the client without any assumption about the implementation of the object. 1/19/2022 B. Ramamurthy 8

Client and IDL z. To call a member function on a CORBA object the client needs only the object’s IDL. z. Client need not know the object’s implementation, location or operating system on which the object runs. 1/19/2022 B. Ramamurthy 9

IDL facilitates internetworking C++ Specify in IDL Use IDL-language compiler Client sees only IDL interface Java smalltalk target object OLE (VB, PB, Delphi) Ada, Cobol etc. 1/19/2022 B. Ramamurthy 10

Separation of Interface and Implementation z. Interface and implementation can be in two different languages. z. Interface abstracts and protects details (trade secrets) from client z. Interface offers a means of expressing design without worrying about implementation. 1/19/2022 B. Ramamurthy 11

ORB : Conceptual View z. When a client invokes a member function on a CORBA object, the ORB intercepts the function call. z. ORB directs the function call across the network to the target object. z. The ORB then collects the results from the function call returns these to the function call. 1/19/2022 B. Ramamurthy 12

Implementation Details Client Object Stub Client Stub ORB Access to the services provided by an Object ORB : (Object-oriented middleware) Object Request Broker ORB mediates transfer between client program and server object. 1/19/2022 B. Ramamurthy 13

CORBA Application Development 1. Define interfaces to the objects in your system using CORBA IDL. 2. Compile these using IDL compiler : this compiler is language specific. IDL - Java compiler generates Java code from IDL definitions. This Java code contains client stub code which allows client code development and A skeleton code which allows implementation of server object code. 1/19/2022 B. Ramamurthy 14

CORBA Application Development (contd. ) 3. Implement client, server code in Java (or what ever language). 4. Compile client. java, server. java and all the other source files generated by IDL compiler. (javac) 5. Register the server (object) with the ORB Implementation Repository. 6. Run CORBA (Ex: Orbix. Web) daemon, the server (if needed) and the client. (java) 1/19/2022 B. Ramamurthy 15

Orbix. Web z. Orbix. Web is an ORB that fully implements CORBA 2. 0 standard (our version). z. All Orbix. Web components and applications communicate using CORBA standard IIOP protocol. 1/19/2022 B. Ramamurthy 16

Orbix. Web Components z IDL compiler (IDL to Java) z Orbix. Web runtime is called by every Orbix. Web program. y. Its components are : DII, DSI, Core ORB functionality y. Our implementation has 25 runtime licenses z Orbix. Web deamon is a process that runs on each server host and implements several ORB components including Implementation Repository. Known as orbixdj z Orbix. Web Interface Repository server implements the Interface Repository. 1/19/2022 B. Ramamurthy 17

Example 1: Twodimensional Grid z. A grid is an abstract view of a number of commonly used components such as spreadsheets or relational (database) tables. 1/19/2022 B. Ramamurthy 18

Defining the IDL Interface //IDL // In file grid. idl interface Grid { readonly attribute short height; readonly aatribute short width; void set (in short row, in short col, in long value); long get (in short row, in short col); }; 1/19/2022 B. Ramamurthy 19

System Configuration z. Before running IDL compiler ensure Orbix. Web can find configuration file Orbix. cfg z. How? IT_CONFIG_PATH should point to the directory in which Orbix. cfg resides. z. This environment variable should have set by the configuration steps that bharat will mail you. 1/19/2022 B. Ramamurthy 20

Compiling the IDL Interface z. Compile the IDL interface using idl -j. P <package name> <idl fname> idl -j. P gridtest grid. idl z. IDL compilation produces many java constructs (interfaces and classes). z. Each one is placed with a filename. java 1/19/2022 B. Ramamurthy 21

Files Generated by IDL Compiler z Each file generated contains a Java interface or class scoped within the package specified by the -j. P switch. z This package is physically located in a directory of the same name according to Java conventions. 1/19/2022 B. Ramamurthy 22

Roles of Generated Interfaces and Classes z Client side files: Grid : an interface to provide a client a view of the methods in the IDL. _Grid. Stub : A Java class that implements the methods defined in interface Grid. Provides functionality that allows client method invocations to be forwarded to a server. 1/19/2022 B. Ramamurthy 23

Interfaces and Classes (contd. ) z Server side files: _Grid. Skeleton : A Java class used internally by Orbix. Web to dispatch incoming server requests to implementation objects. _Grid. Impl. Base : An abstract Java class that allows server-side developers to implement the Grid interface. Other files : Grid. Implementation, _tie_Grid, _Grid. Operations used in the implementation on the server side. 1/19/2022 B. Ramamurthy 24

Interfaces and Classes (contd. ) z. Client and Server Files: Grid. Helper : Java class that allows IDL user-defined types to be manipulated various ways. (Hint : look at “any” type) Grid. Holder : For inout parameters. Grid. Package : For holding data structures such as union, structures etc. 1/19/2022 B. Ramamurthy 25

Implementing the Interfaces z. Grid. Implementation is an class which implements abstract class _Grid. Impl. Base which in turn extends _Grid. Skeleton and implements Grid interface. z. Look at the code for Grid. Implementation. java since this is one of the programs you have to write. 1/19/2022 B. Ramamurthy 26

Writing Server Application z. All the servers and clients must call org. omg. CORBA. ORB. init() to initialize an ORB. z. Server object initialization and shutting down are carried by the server application. z. See enclosed code. 1/19/2022 B. Ramamurthy 27

Compiling Server Application z Server compilation needs access to classes from Java API, org. omg. CORBA, IE. Iona. Orbix. Web, any other classes needed by the application. z Source files to be compiled on the server side are: gridtest/_Grid. Skeleton. java gridtest/_Grid. Impl. Base. java gridtest/_Grid. java gridtest/Grid. Implementation. java gridtest/Grid. Server. java 1/19/2022 B. Ramamurthy 28

Overview of Compilation Process Grid. idl IDL Compiler _Grid. Stub _Grid. Skeleton Classes & interfaces Grid client application Java compiler Server byte code Client byte code 1/19/2022 Grid server application B. Ramamurthy 29

Registering the Server z. To allow automatic launching of a server you need to register the server in the Implementation Repository(IR). z. IR is database that holds the mapping between server name and byte code. putit <servername> -j <classname> putit Gris. Srv -j gridtest. javaserver 1/19/2022 B. Ramamurthy 30

Writing Client Application z. Lets look at the code and analyze the client code both a simple version and an exception handling version. z. An important function is bind which creates a proxy object and binds it to the server (object) name in the IR. 1/19/2022 B. Ramamurthy 31

Compiling Client Application z. Compile using Java these source files of the client application: gridtest/_Grid. Stub. java gridtest/Grid. java gridtest/Client. java 1/19/2022 B. Ramamurthy 32

Running Client Application z. For the demo program given in the Orbix. Web 3. 0/demos directory Makefiles are also provided. z. So simple go gmake all and follow the instruction for launching the application that follows a successful compilation. 1/19/2022 B. Ramamurthy 33

Example 2: Grid Applet z. Server is same but the client an applet with graphical IO. 1/19/2022 B. Ramamurthy 34

Orbix. Web Commands zlsit : list of server objects available zpsit : list of server objects active zrmit : remove a object from repository zcatit : list the details of the server object 1/19/2022 B. Ramamurthy 35

Summary z. We introduced general operation of CORBA. z. Also details of specifying a client, server application, compiling them and registering and running. z. You will have to configure your system before you try to do these steps. 1/19/2022 B. Ramamurthy 36
- Slides: 36