1 / 12

Building a CORBA Server

Building a CORBA Server. Basic Steps for Building a CORBA Server. 1 . Define the server's interfaces using IDL. 2 . Choose an implementation approach for the server's interfaces. 3 . Use the IDL compiler to generate client stubs and server skeletons for the server interfaces.

Download Presentation

Building a CORBA Server

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. Building a CORBA Server

  2. Basic Steps for Building a CORBA Server 1. Define the server's interfaces using IDL. 2. Choose an implementation approach for the server's interfaces. 3. Use the IDL compiler to generate client stubs and server skeletons for the server interfaces. 4. Implement the server interfaces. 5. Compile the server application. 6. Run the server application.

  3. 1. Defining the Server Interfaces • // StockMarket.idl • module StockMarket • { • typedef string StockSymbol; • typedef sequence<StockSymbol> StockSymbolList; • interface StockServer • { • float getStockValue(in StockSymbol symbol); • StockSymbolList getStockSymbols(); • }; • };

  4. 2. Choosing an Implementation Approach • Implementation by inheritance • consists of a base class that defines the interfaces of a particular object and a separate class, inheriting from this base class, which provides the actual implementations of these interfaces • Implementation by delegation • consists of a class that defines the interfaces for an object and then delegates their implementations to another class or classes.

  5. 3. Using the IDL Compiler • Sun's Java IDL product is this: idltojava -fno-cpp -fclient -fserver StockMarket.idl • IDL Compiler generate number of files • Helper classes • Client Stub classes • Server Stub classes • The names of the files generated by the IDL compiler are dependent on the language mapping used and sometimes on command-line arguments passed to the IDL compiler.

  6. Using the IDL Compiler (Cont) • For each IDL interface compiler generate • a source file and header file for the client stub • a source file and header file for the server skeleton • IDL Compiler can create separate directories for IDL module.

  7. 4. Implementing the Server Interfaces • To keep the example as simple Java is used as implementation language.

  8. i) Using Server Skeletons • The server skeleton, as you have learned, provides a framework upon which to build the server implementation. • In Java, a server skeleton combines a set of helper classes with an interface, for providing the implementation.

  9. After Compilation within StockMarket directory are a number of files containing client stub and server skeleton definitions: StockSymbolHelper.java StockSymbolListHolder.java StockSymbolListHelper.java StockServer.java StockServerHolder.java StockServerHelper.java _StockServerStub.java _StockServerImplBase.java

  10. StockServer.java • package StockMarket; • public interface StockServer extends org.omg.CORBA.Object • { • float getStockValue(String symbol); • String[] getStockSymbols(); • }

More Related