Presentation is loading. Please wait.

Presentation is loading. Please wait.

CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) (http://www.omg.org) Specification.

Similar presentations


Presentation on theme: "CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) (http://www.omg.org) Specification."— Presentation transcript:

1 CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) (http://www.omg.org) Specification Java IDL (jdk1.2) use CORBA objects with Java Programming Language

2 Introduction Technology for Distributed Objects Similar in function to Java RMI Not Java-centric Any language with IDL specification IDL is a language-neutral interface definition language Object Requst Broker (ORB) enables low- level communication between CORBA Objects

3 CORBA Architecture

4 Client and Server Relationships common to CORBA and RMI Server provides remote interface Client calls remote interface Object level interaction rather than application level interaction (sockets) Objects can fulfill both roles

5 Client Side Client has reference to remote object Object reference has a stub method Stand-in for remote method Stub wired into ORB Call on stub invokes ORB’s low-level communication routines ORB forwards invocation to server

6 Server Side ORB on Server Side uses Skeleton Code to translate remote invocation into call on the local object Skeleton transforms results or errors and returns to ORB for delivery to client ORB-ORB communication with IIOP (Internet Inter-ORB Protocol)

7 ORB Different Vendors IIOP based on TCP/IP by OMG ORB Services –Look up (JDK1.2) –Object Persistence –Transactions –Messaging

8 Java IDL Development Define interface to Remote Object with IDL idltojava compiler generates stub and skeleton source, and code to interface with ORB IDL interface can be implemented in any CORBA compliant language (C, C++, Smalltalk, COBOL, Ada)

9 Compile remote interface ( idltojava ) Implement the server. It should start ORB and wait on invocations from clients, as well as implement remote methods. Implement client. Start ORB, look up server, obtain remote reference, and call remote method Start applications.

10 Example Hello World has single remote method that returns a string to be displayed. Client invokes sayHello on Hello server ORB transfers invocation to servant object registered for interface Servant’s sayHello runs, returns String ORB transfers String back to client Client Displays String

11 Hello.idl

12 CORBA module is name space that is a container for related interfaces and definitions. Like a Java Package module statement mapped to java package statement interface specifies contract object has with other objects interface to interface in java

13 CORBA operations are behaviors that server promises to do on client’s behalf operation to method in java idltojava Hello.idl creates a HelloApp directory, and five files. _ HelloImplBase.java : Abstract class is the server skeloton. It implements Hello.java. Server class will extend this class. _ HelloStub.java : Client stub. Implements Hello.java

14 Hello.java : Java version of IDL interface. Subclasses org.omg.CORBA.Object to provide base CORBA functionality. HelloHelper.java : Provides other functionality. narrow method cast CORBA object reference to proper type. HelloHolder.java : final class provides out and inout arguments (more later).

15

16

17

18

19

20 Client Needs ORB object to do marshaling and IIOP Instantiate ORB object and pass it information Asks ORB for service it needs Gets object reference from COS naming service provided with Java IDL

21 Get reference to naming service All CORBA object references returned as generic CORBA object Must narrow it to its proper type NameComponent for complex names, including fully qualified paths resolve naming context narrow to proper type invoke method

22

23 Server Servant object implements the interface Create ORB COS Naming: get instance and narrow Register servant with name server WAIT

24

25 Running the Example Compile the files generated by idltojava Compile client and server start name service: tnameserv -ORBInitialPort 1050 start client and server java HelloServer -ORBInitialPort 1050 java HelloClient -ORBInitialPort 1050


Download ppt "CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) (http://www.omg.org) Specification."

Similar presentations


Ads by Google