PreviousCoborbgen The Order ExampleNext

Chapter 3: The Grid Example

The Grid example illustrates support for CORBA within Server Express.


Note: This example application is only available if you have obtained the ORB interface software from MERANT. See the chapter Obtaining Support for details.


3.1 Installation

To run this example:

  1. Change to the example program directory $COBDIR/demo/corba/grid.

    This directory contains a simple client and server, written in COBOL, and a makefile. The makefile is there for you to run when you wish to compile both modules and then link them together into an executable.

  2. Copy the contents of the directory $COBDIR/demo/corba/grid into a working directory of your own.

  3. To run the example, follow the detailed instructions below.

3.2 Source Files

The source files for the Grid example are listed below:

$COBDIR/demo/corba/grid/gridsv.cbl
$COBDIR/demo/corba/grid/gridcl.cbl
$COBDIR/demo/corba/grid/makefile

3.3 Prerequisites

For details of prerequisites, refer to the section Prerequisites in the Coborbgen chapter.

3.4 Running the Example for Orbix

  1. To wrap the example program using C++, enter:
        make orbix

    This runs the command line:

        coborbgen gridsv -client gridcl -v -make -debug -orbix

    which generates the following files:

    gridsv_C.cc C++ for client to invoke remote C++ object
    gridsv_S.cc C++ to create instance of C++ object
    gridsv_i.h header file for Object instance
    gridsv_i.cc C++ instance of object that wraps the COBOL
    gridsv.mak makefile to build executable

  2. To compile the generated output into executables, run the generated makefile:
        make -f gridsv.mak

    This command compiles all the generated code and then links it all together with the appropriate libraries.

  3. Once you have finished building your executables, start the Orbix deamon.

  4. Use the command putit within the generated makefile to register the application with Orbix:
        make -f dbac.mak putit
  5. Once defined, you need to run the client only and Orbix starts the server automatically. To start up the server on the localhost by default, enter:
        gridsv-c

    The generated client can accept a hostname on the command line but, by default, uses the local host. (You can, of course, start your gridsv-s server manually, if you so wish.)

  6. The client:

  7. To terminate the server use the Orbix command killit as follows:
        killit gridsv

3.5 Running the Example for Visibroker

  1. To wrap the example program using C++, enter:
        make visi

    This runs the command line:

        coborbgen gridsv -client gridcl -v -make -debug -visi

    which generates the following files:

    gridsv.idl IDL for the interface to the component
    gridsv-s.cbl wrapper to handle COBOL datatypes for server
    gridsv-c.cbl wrapper to handle COBOL datatypes for client
    gridsvC.cc C++ for client to invoke remote C++ object
    gridsvS.cc C++ to create instance of C++ object
    gridsv_i.h header file for object
    gridsv_i.cc C++ instance of object that wraps the COBOL
    gridsv.mak makefile to build executable

  2. To compile the generated output into executables, run the generated makefile:
        make -f gridsv.mak

    This command compiles all the generated code and then links it all together with the appropriate libraries.

  3. Once you have finished building your executables, start the Visibroker Smart Agent, if it is not already running.

  4. Start the gridsv-s server by typing:
        gridsv-s &
  5. Start the gridsv-c client by typing:
        gridsv-c
  6. The client:


Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousCoborbgen The Order ExampleNext