Home : Course Map : Chapter 19 :
CORBA Client/Server Support Files
JavaTech
Course Map
Chapter 19

Introduction
Server Demo
Client Demo
Demo Support
Resources

Exercises

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

The additional files provided include:

The path for the files go as the following diagram:

javatech-19
  |
  |__idfiles (generated by build.bat)
  |
  |
__ src
        |
        |__ javatech
              |
              |__ cor19
                    |
                    |__ client
                    |
                    |__ server
                          |
                          |__ impl

The support

The IDL files listed in Table 19.1 in the book are generated with the command

idlj -fall -td idlfiles src/server.idl

where server.idl lies in the src directory. As mentioned in the text, the code is rather opaque and not of interest to the developer. So we will not display them here. The build.bat command file includes the above command to generate them.

The IDL module file is shown here:

server.idl

module javatech {
   module cor19 {
     const string COR19_CONSTANT = "Chapter 19";
      module server {

        const string SERVER_CONSTANT = "JavaTech Book";

        exception Cor19UserException {
          string message;
        }; // exception Cor19UserException

        struct CustomData {
          float someFloatValue;
          long someIntegerValue;
        }; // struct CustomData

        interface Cor19Example {
           const long COR19_EXAMPLE_CONSTANT = 19;
           attribute long huh;
           readonly attribute float hah;
           void method1 (in string s);
           long add (in long a, in long b);
           void demo (inout CustomData cd) raises (Cor19UserException);
         }; // interface Cor19
      };
   };
};

 

The build, cleanup, and run command files are listed below. (To fit within the table here, in some places the command lines are broken where indicated. In the actual files there are no line breaks.) They lie in the javatech-19 directory.

build.bat

@rem Builds everything for the CORBA examples in Chapter 19.

setlocal
set idl_out=build/idlfiles
set class_dir=build/classes
set impl_dir=src/javatech/cor19/server/impl
set client_dir=src/javatech/cor19/client

@rem First run the idlj compiler
idlj -fall -td %idl_out% src/server.idl

@rem Compile the Java sources
mkdir build\classes
javac -classpath %class_dir% -d %class_dir% %idl_out%/javatech/cor19/*.java
javac -classpath %class_dir% -d %class_dir% %idl_out%/javatech/cor19/server/*.java
javac -classpath %class_dir% -d %class_dir% %impl_dir%/*.java
javac -classpath %class_dir% -d %class_dir% %client_dir%/*.java

endlocal

clean.bat
@rem Clean up the build directory by deleting it.
rmdir/s/q build orb.db
client.bat
@rem Run the client
java -Dorg.omg.CORBA.ORBInitialPort=3001 -Dorg.omg.CORBA.ORBInitialHost=localhost ...no break... -classpath build/classes javatech.cor19.client.Client -ORBInitialPort . .. no break... 3001
server.bat

@rem Run the server
start orbd -ORBInitialHost localhost -ORBInitialPort 3001
java -classpath build/classes -Dorg.omg.CORBA.ORBInitialPort=3001 ...no break... javatech.cor19.server.impl.Cor19Server

 

 

Most recent update: Oct. 13, 2005

  
  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.