1 / 9

A First Java ORB Application

Learn how to develop a Java ORB application using CORBA to build a HelloWorld interface. Understand the CORBA application development process, interface specification, and generated files. Implement the client and server sides of the application.

pweston
Télécharger la présentation

A First Java ORB Application

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A First Java ORB Application • Object Request Broker (ORB) • This is the object manager in CORBA • Mechanisms for specifying interfaces • Interface Definition Language (IDL) - for static interface definitions • Dynamic Invocation Interface (DII) - lets clients access interfaces as first-class objects at run-time from an Interface Repository. • Internet Inter-Orb Protocol (IIOP) • A binary protocol for communication between ORBs. • Was added in CORBA 2.0 A First Java ORB Application

  2. CORBA Application Development Process • Write IDL • Compile IDL • Identify the IDL compiler-generated interfaces and classes that we need • Write code to initialize the ORB and inform it of any CORBA objects created • Compile all the generated code and application code • Run the application A First Java ORB Application

  3. Building CORBA Application Hello world A First Java ORB Application

  4. Interface Specification // idl file module helloWorld{ interface GoodDay{ string hello(); }; }; • Compile the idl file, generate the following set of files: GoodDay.java GoodDayHolder.java GoodDayHelper.java _GoodDayStub.java GoodDayPOA.java GoodDayOperations.java GoodDayPOATie.java A First Java ORB Application

  5. Generated Files • GoodDay.java: java interface mapped from IDL interface • GoodDayHolder: provide support to handle IDL inout and out parameters • GoodDayHelper: contains supporting methods, most used one is narrow() • _GoodDayStub.java: client side stub code • GoodDayPOA.java: contains the skeleton code that is used with POA • GoodDayOperations.java and GoodDayPOATie.java contain skeleton code that are used with Tie approach A First Java ORB Application

  6. Client Side • Initialize the CORBA environment: obtain a reference to the ORB • Obtain an object reference for the object on which to invoke operations • Invoke operation and process the results • Example • Code from Ch. 4 A First Java ORB Application

  7. Server Side • Initialize the CORBA environment, the ORB (the same as client side) • Create implementation object • Make the implementation object accessible by clients • Listens for events • Code • Ch4 server code A First Java ORB Application

  8. Holder Type for out and inout parameters shorterHolder minute; Holder Object public short value; A First Java ORB Application

  9. Extending the Hello Example … string hello(out short hour, out short minute); }; … }; A First Java ORB Application

More Related