90 likes | 109 Views
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.
E N D
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
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
Building CORBA Application Hello world A First Java ORB Application
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
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
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
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
Holder Type for out and inout parameters shorterHolder minute; Holder Object public short value; A First Java ORB Application
Extending the Hello Example … string hello(out short hour, out short minute); }; … }; A First Java ORB Application