ISIS technical report series, Vol.

24, April, 2000

Practical tutorial for using Corba
A step-by-step introduction to the Common Object Request Broker Architecture

Jan van Gemert

Intelligent Sensory Information Systems Department of Computer Science University of Amsterdam The Netherlands

A compact step-by-step tutorial for creating a CORBA object to get some hands-on experience with the Common Object Request Broker Architecture. Corba enables platform, language and network transparency. How to use a C++ object created on a Windows NT, in a Java program running on Unix.

Practical tutorial for using Corba

Contents
1 Introduction 1.1 Description of files used . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Applications used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Install Orbacus 4.0 beta 2 2.1 Installing Orbacus for the C++ server . . . . . . . . . . . . . . . . . 2.2 Installing Orbacus for the Java client . . . . . . . . . . . . . . . . . . 3 Environmental Changes 3.1 Variable settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 MS visual C++ settings . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Orbacus configuration files . . . . . . . . . . . . . . . . . . . . . . . . 4 Specify the object in IDL 5 Setting up the C++ Server 5.1 Compile IDL file . . . . . . . . 5.2 Implement the servant object . 5.2.1 Example of Count i.h . 5.2.2 Example of Count i.cpp 5.3 Implement the server . . . . . . 5.3.1 Server.cpp code . . . . . 1 2 2 3 3 4 5 5 6 7 9 10 10 10 11 12 13 14 15 15 15 16 17

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

6 Setting up the Java Client 6.1 Compile IDL file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Implement the client . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Client.java code . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Running the example

Intelligent Sensory Information Systems Department of Computer Science University of Amsterdam Kruislaan 403 1098 SJ Amsterdam The Netherlands
tel: +31 20 525 7463 fax: +31 20 525 7490 http://www.science.uva.nl/research/isis

Corresponding author: Jan van Gemert tel: +31(20)525 7507 jvgemert@science.uva.nl www.science.uva.nl/~jvgemert

The choice for such an object.at/Research/Corba/homepage.Section 1 Introduction 1 1 Introduction This small practical tutorial is a doorway to the world of the Common Object Request Broker Architecture.com/ (implementers of this CORBA version) http://www. Do you know what an IOR is? What is IDL used for? Skeletons? Stubs? Etc.0b3.asp Here also. Exception handling is mainly not done in this tutorial. Whereas the execution of the example is described in section 6. some understanding of Java.sun. The idea of this simple object was found in [1]. For further information about CORBA. nor does it explain in detail how CORBA uses its magic. Where section 2 will let you adapt the environmental conditions to let Orbacus flourish. Section 1 will guide you through the installation and compilation of Orbacus 4. Just know how to create and compile a new Visual C++ project. C++ and Microsoft Visual C++ (MSVC) is required.com/docs/books/tutorial/ http://msdn.pdf.java.org/ (creators of CORBA) http://www.0 beta 2.zip file. check the included OB-4. It’s just a step by step practical tutorial for creating a CORBA C++ server with a Java client.com/visualc/technical/documentation. Where the IDL definition is compiled to C++ in order to set up the server in section 4. I recommend these sites: http://java. Its small steps are backed up with some chunks of fast-food files.net/ http://developer.corba. just a grasp of the basics is enough. containing a number that can be set. is based on its simplicity as its display of client-server interaction.com/developer/onlineTraining/corba/ http://www. just waiting to be compiled and executed. What you have here. Yes young Java Knight. I recommend these sites: http://www.html From now on. The University of Amsterdam disclaims any warranty and takes no responsibility for damages of any kind for the software based upon this tutorial. is no theoretical work. section 3 specifies the Count object in the Interface Definition Language.omg. this will give you the powers to use transparent inter-language client-server relationships between objects. compile and run Java code. no expertise is really required.sun. . Furthermore.ooc.infosys. the CORBA fundamentals are presumed as known. This document will allow you to create a working implementation of the CORBA architecture. in a small amount of time.microsoft. in order to focus on the main goal of implementing a CORBA object. You do not have to master the details of it. and know how to write a simple C++ class.ac. This document provides a framework for implementing a simple count object. The client is implemented in section 5. read and incremented by 1.tuwien. For information about them. Additionally.

Code of the C++ Server. Language independent definition of the object.bat Client.Jar files for Java. License agreement for free use of Orbacus. Code of the Java Client. MS visual C++ project and workspace files. Documentation file for Orbacus .2.0b3. Batch file for Sever Variable settings. System Properties for Orbacus for C++.h] server. File: LearnCorba.doc Licence.zip OB-4.pdf.cfg orbacusVars.cpp .1 Description of files used Description: This tutorial document. Batch file for Client variable settings.* orbacus.zip JOB-4_0b2_jars. Orbacus precompiled .2 Jan van Gemert 1.properties orbacusClient.zip Count.cpp .doc OB-4_0b2. Orbacus source code for C++.* orbacus.idl Count_i[.bat 1.2. .2 Applications used • MS Windows NT • MS Word • Acrobat reader • WinZip • Microsoft visual C++ • JDK1.h] Server[. System Properties for Orbacus for Java. C++ Implementation of the count-object.

ooc.mak clean’ to delete files used during compilation which are no longer needed (will create some space on your drive).0 for C++. using ’nmake /f Makefile. A sub-directory is created. use ’nmake /f Makefile. 5 Recommended.zip.zip to a directory of your choice (e. For more details about this. Go to the Orbacus source directory (OB-4. D:\OOCb4). 1 According to the OOC help file. . and Windows NT (not win95/win98).mak. the implementers of Orbacus.mak install’ (this will take some time. but you should be able to continue with this tutorial until IDL-file compilation). To properly install Orbacus. like in this tutorial. The URL of their site: http://www.WINDOWS and the file Makefile. At least set the installation directory.0 beta 2 3 2 Install Orbacus 4. This will install Orbacus in the prefix directory (e. This file contains the C++ source code of the Orbacus 4. The Orbacus files were downloaded from the Object Oriented Concepts site. If all goes well.0b2.doc. and run the batch file vcvars32. The source code is no longer necessary.g. Without it. For more information about installing Orbacus. not much corbaing can be done. so if you´ re lacking hard drive space you can delete at will.1 Installing Orbacus for the C++ server Supplemented with this package is a . for me about 50 minutes. For example set it to prefix = D:\OOCb4. 2. 1 To Do: 1 Unzip the file OB-4_0b2. you should now have a compiled pile of about 75 MB of fresh Orbacus in your installation directory. This ORB. is to install Orbacus. 4 In DOS. see the files INSTALL. OB\README.0 beta 2 The first thing to do. called OB-4.0b2) Compile Orbacus.WINDOWS.com/.g.zip file called OB-4_0b2.Section 2 Install Orbacus 4. D:\OrbacusSrc).mak according to the instructions in the comments in that file and make the appropriate changes. take a look at the file licence. a Corba implementation) is free for non-commercial use. you need approximately 150 MB of free disk space (250 MB to be sure). 3 Open a DOS box. (Object Request Broker.bat (included in MSVC) to set compilation environmental variables. configure and compile the source code. we have to unzip.rules. 2 Edit the file config\Make.

To Do: 1 Unzip the file JOB-4_0b2_jars.D:\OOCb4\BIN).g. D:\OOCb4\jars\). 3 Add to this bath file a line which inserts the executable directory in the search path (e.OrbacusClient.zip to a directory of your choice (e.zip contains all the pre-compiled . For easy access to the executables in this directory. PATH=%PATH%.jar. 2 Create a batchfile (e.jar to the Classpath variable. and for example contains this line: SET CLASSPATH= %CLASSPATH%. all we need to do is to unzip the Jars and adapt the Classpath variable used by Java to locate .2 Installing Orbacus for the Java client The file JOB-4_0b2_jars.jar files needed to use Orbacus for Java.bat) which adds the OB.g.g.d:\oocb4\jars\ob.jar. So.4 Jan van Gemert 2. .d:\oocb4\jars\obnaming.jar and the OBNaming.jar files.

in order to let Orbacus and Microsoft visual C++ work together.1 Variable settings In order to let MSVC find Orbacus-libraries and includes. more about this in section 3. Make sure vcvars32. some variables have to be set. not needed for Orbacus but makes life easier in MSVC. if not defined INCLUDE call vcvars32 rem set root directory to 1e parameter. • Sets the ORBACUS_CONFIG variable. • Adds the Orbacus executables (OBC_ROOT\bin) in the search path. so we have to create it ourselves.bat: @echo off if not defined INCLUDE call vcvars32 echo Setting environment for using ORBacus 4. or to the default set OBC_ROOT=%1 if not defined OBC_ROOT set OBC_ROOT=D:\OOCb4 rem add Orbacus binaries to search-path set PATH=%PATH%. Some variables need to be set. (calls vcvars32. which points to a configuration file used by Orbacus. . Start MS Visual C++ (type msdev at the DOS prompt. This. Call OrbacusVars. the batch file OrbacusVars. (this configuration file isn´ t standard included with Orbacus.3). D:\OOCb4). so the dos-box environment settings (variable values) sustain within MSVC).%OBC_ROOT%\bin rem set location of configuration file.Section 3 Environmental Changes 5 3 Environmental Changes The working environment has to be adapted.0 beta2 for C++ rem if not already done. which is included in the bin directory of MSVC). OrbacusVars. some MSVC settings got to change and a configuration file has to be created. 3. This variable should contain the path to the installation directory of Orbacus (e. so we can easy reference the path to Orbacus in MSVC.bat. set ORBACUS_CONFIG=%OBC_ROOT%\etc\orbacus.g.bat.bat is in your path. This file: • Sets a helpful MS-DOS variable OBC_ROOT.cfg To Do: 1 2 3 Open a DOS box.bat is included in this package. For this. set MS-visual C++ vars. • Sets MSVC environment variables.

server) Open the menu project settings. Because we compiled Orbacus with the default settings. it is added to the system directories. For more details about multithreading options.lib and CosNaming. is that Orbacus will generate files.lib so. To change this default compilation option.rules. which use the statement: #include <count. To Do: 1 2 3 4 5 6 7 8 Start an empty workspace and a new win32 console project (e.2 MS visual C++ settings Microsoft Visual C++ also has to be configured.’ ) ). . Details: The reason for including the current directory in the include directory path. In tab C/C++. Set settings for: to all configurations (both debug and release).lib. category code generation change the setting use runtime library set to Multithreaded DLL. change the file config\Make. You can find these files in OBC_ROOT\lib. • The corresponding libraries have to be added to the project.g. category: Pre processor Set additional include Directory to: ’.h". By including the current directory. add this library to tab Link. category Input add to the setting object/library modules the library wsock32.WINDOWS. the compiler setting Multithreading DLL was used. $(OBC_ROOT)\include’ (Yes. Add to the project. Orbacus makes use of the wsock32. refer to the MSVC documentation and the file: OB\README.lib and uses Run Time Type checking Information. We have to keep doing this in our project. include the current directory ( ’. in order to work with Orbacus: • The OBC_ROOT variable has to be added to the include-path. The source files can now be in the same directory as the project files.lib. In tab C/C++.6 Jan van Gemert 3. for example in the folder Resource files the needed libraries ob. This does mean that the source files have to be in a system directory of MSVC. • Multithreading DLL has to be set.. In tab C/C++.mak and re-compile Orbacus. • Run Time Type checking has to be enabled. category C++ language change the setting Enable Run-time Type Information (RTTI) to yes.h> instead of #include "count. Orbacus uses wsock32.

properties).NameService= to the IOR just read of the naming service in step 1. the IOR of the name service in ooc.g.Section 3 Environmental Changes 7 3. 8001). just an easy way to store it. Also.properties in for example the java.Properties. Furthermore. is just a system property list for Java.NameService=. In the \BIN directory you can find the executable Nameserv. The Client configuration file. insert the following lines in this file: ooc.ORBSingletonClass=com. distributed file locations have their advantages over central stored settings.orb.load (more on this in section 6).service. For an example of an Orbacus configuration file. The location of the configuration files is not compulsory. Just like the server configuration. we have to specify some more settings. 7 Also. by typing nsadmin -h the options of the naming service administration program appear on the screen.omg. By typing Nameserv -h you can see the options. which can and will easily be loaded using the method java.ORBSingleton.CORBA. C:\Java\JRE\1. 5 For the Client: Create a textfile for example Orbacus. the program nsadmin. the IP-port on which the naming service will listen has to be set.CORBA.CORBA. Remember that the exact IOR of your naming server will differ from the example specified below. instead of IOR strings.ooc. This can be any free IP-port (e. To Do: 1 Print the IOR of the name service listening on port 8001 by typing Nameserv -i -OAport 8001 (this will automatically start the naming service. Two different configuration files (one for C++ and one for Java) have no apparent use on just one machine.home\lib directory (e.cfg ). use ctrl-c to abort). When using a network. The naming service converts an object name to an IOR. the IOR of the naming service has to be known. Also.exe corresponding with the naming service.util. but leave it as a whole string. 3 Specify the ooc.g. OBC_ROOT\etc\orbacus. . which allows human object naming. In order to let Orbacus find this naming service in its initial references. see below.2\lib\orbacus. and be sure not to break up the IOR. 6 Set Orbacus as the ORB.ooc.service.exe lets you manage the naming service from the commandline. and make sure it has the same name and path as in the variable ORBACUS_CONFIG. 2 For the Server: Create a textfile with a filename specified as in the variable ORBACUS_CONFIG in the variable settings (e.CORBA.omg.ORBClass=com.3 Orbacus configuration files In order to let Orbacus work with the naming service.ORB ooc. specify in this file.g. 4 Save the file.

CORBA.ooc.CORBA.CORBA.omg.cfg: # Initial references: ooc.NameService=IOR:010000002a00000049444c3a6f6f632e6 36f6d2f436f734e616d696e672f4f424e616d696e67436f6e746578743a312e30 00000002000000000000004c000000010102001600000070632d6373797330392 e77696e732e7576612e6e6c00411f24000000abacab305f526f6f74504f410049 494f504c4f43504f4100004e616d655365727669636500000000010000007c000 0000101020001000000010000006c00000001000000010001000a000000020001 00030001000400010005000100060001000700010008000100090001000100010 520000100090101000c0000000001010001000100020001000300010004000100 05000100060001000700010008000100090001000100010520000100 . and ignored) file: orbacus.ORB org.ooc.8 Jan van Gemert Example of the Orbacus configuration file for C++ sever: (Lines starting with # are comment.NameService=IOR:010000002a00000049444c3a6f6f632e636f6 d2f436f734e616d696e672f4f424e616d696e67436f6e746578743a312e300000 0002000000000000004c000000010102001600000070632d6373797330392e776 96e732e7576612e6e6c00411f24000000abacab305f526f6f74504f410049494f 504c4f43504f4100004e616d655365727669636500000000010000007c0000000 101020001000000010000006c00000001000000010001000a0000000200010003 00010004000100050001000600010007000100080001000900010001000105200 00100090101000c00000000010100010001000200010003000100040001000500 0100060001000700010008000100090001000100010520000100 Example of the Orbacus configuration file for the Java client: (Lines starting with # are comment.ORBClass=com.properties: # Using ORBacus ORB: org.CORBA.orb.ORBSingletonClass=com.omg.ORBSingleton # set IOR of the nameservice: ooc. and ignored) file: Orbacus.service.service.

Add to output: $(InputDir)/$(InputName).exe) within MSVC. is a Count object.idl): module Counter { interface Count { attribute long sum. which can be incremented using the method increment. Choose settings of the IDL file. This description forms the foundation on which the server. client and objects are built. This attribute is a long called sum.2 ). Select the settings for all configurations (both debug and release) Select custom build and add to command: cd /D \$(InputDir) $(OBC_ROOT)\bin\idl $(InputPath).h $(InputDir)/$(InputName). The object has to be described in the Interface Definition Language (IDL). long increment(). which effect the servant object´ s attribute. to compile the IDL file with the Orbacus IDL to C++ compiler (idl. }. .Section 4 Specify the object in IDL 9 4 Specify the object in IDL The methods and properties of an object have to be known to both the server as the client. which also returns the new value of the attribute.h $(InputDir)/$(InputName)_skel. Add the IDL file to the project. It is a simple object with only 1 method and 1 attribute. see section 3. The object described. and to update the generated files automatically. It generates a read and a write function with the same name of the attribute specified in IDL. All this is necessary.cpp. An attribute in IDL is not like a real member variable of a class. The IDL file (Count. }.cpp $(InputDir)/$(InputName)_skel.idl and save it in the same directory as the project (this in order to let MSVC find the include files in the current directory. To Do: 1 2 3 4 5 6 Create a text file count.

in order to auto-generate Server Skeletons and Client Stubs.h Count.h Count_skel.h we can see the virtual functions which need implementing. In the file Count_skel. • To increment the value of the property sum.cpp. A description of these functions: • To request the value of the property sum: virtual CORBA::Long sum() .* is used for the Client and for the Server. the object implementation (servant) and the server itself have to be written. is done by the server. Count. which by definition. is called a servant object. the linker will complain that it has nothing to link with).exe) generates a number of files needed to successfully implement object transparency. and return this value. as defined in the IDL definition.10 Jan van Gemert 5 Setting up the C++ Server To set up a CORBA server the IDL file has to be compiled. To do so. Add following generated files to your project: Count. 5. in MSVC. if you try to build the entire project.cpp Count_skel. which inherits from the abstract server class Count_skel. Count.* is used only for the server and contains the abstract class of the implementation of the object.2 Implement the servant object The implementation of the object.h contains definitions of the IDL types. we need to create a class. Count_skel. the method increment: virtual CORBA::Long increment(). Also. 5. (note. To Do: 1 2 Compile IDL file. • To set the value of the property sum: virtual void sum(CORBA::Long _itvar_sum) .1 Compile IDL file Compilation of the IDL file with the IDL-compiler as provided with Orbacus (BIN\idl. . The task of the servant is to create the functionality required by the object. with compile button.

and add it to the project. 5.h #include <OB/CORBA.h" #include "iostream. With above functions and a constructor (and facultative a destructor) inherit from the class public POA_Counter::Count\verb in the file Count_Skel.h> #include "Count_skel. . Conform naming conventions. private: long The_Sum .cpp and add it to the project. // destructor ~Count_i() . Implement this headerfile. // set sum value void sum(CORBA::Long _itvar_sum) .Section 5 Setting up the C++ Server 11 Now. // increment sum value CORBA::Long increment() .h and Count_i.1 Example of Count i. // get sum value CORBA::Long sum() .h. we need to create the code for the implementation. Count_i.cpp: To Do: 1 2 Create a new file in the project directory. Include a private member to contain the sum-value. Implement this file with the required code as specified in the headerfile. (an Example of this file is given below). so you can either make your own implementation. or use the one supplied. }. Count_i. Create a new file in the project directory. (An example of this file is given below. we create the files Count_i.2.h.h" // inherit from the Server class Count class Count_i : public POA_Counter::Count { public: // constructor Count_i() .) 3 4 All files are included in the package.

} CORBA::Long Count_i::sum(){ // get value of sum return this->The_Sum . return this->The_Sum . } void Count_i::sum(CORBA::Long value){ // set value of sum this->The_Sum = value.cpp #include "Count_i. this->The_Sum = 0 .2 Example of Count i. } CORBA::Long Count_i::increment(){ // increment value of sum by 1 this->The_Sum ++ .h" Count_i::Count_i(){ cout << "Created Count object" << endl . } Count_i::~Count_i(){ cout << "Gone is the Count object" << endl . } .12 Jan van Gemert 5.2.

The namingService provides the IOR of an object.3 Implement the server To setup the server we have to: • Initialize the ORB. See the next page. • Bind the servant object to a POA. The servant object is the implementation of the object. . The namingService lets you associate names with objects. For running the example. refer to section 7. Now. • Activate the POA manager. provides the mechanism by which a server process maps CORBA objects to language-specific implementation (servants). A portable object adapter (POA). • Create and bind a name to the servant object. for an example of the server code. • Run the ORB. • Create the servant object. you should be able to build the server code.Section 5 Setting up the C++ Server 13 5. • Find a reference to the RootPOA.

c).h> int main( int argc. // Create CORBA object and use it to register // servant object reference with the POA Count_i servant . poa->activate_object(&servant) .h" #include <iostream.1 Server.h> #include <OB/CosNaming. c). CORBA::String_var str = orb->object_to_string(c). argv). CORBA::Object_var objVarNaming . char **argv) { // initialise the ORB CORBA::ORB_var orb = CORBA::ORB_init(argc.cpp code #include <OB/CORBA.. // print IOR of object.3. // get object reference CORBA::Object_var c = poa->servant_to_reference(&servant) . } . orb->run() . cout << "Activating the POA manager. poa = PortableServer::POA::_narrow(poaObject) . poa->the_POAManager()->activate() . poaObject = orb->resolve_initial_references("RootPOA"). name = rootCxtExt->to_name("The counter").. just in case.\n" << endl.14 Jan van Gemert 5. rootCxtExt = CosNaming::NamingContextExt::_narrow(objVarNaming) . // add the count name to the root NameService CosNaming::Name_var name . // finding rootPoa CORBA::Object_var poaObject .h> #include "Count_i. // use REbind if the nameservice is already initialized // only use bind the first time you bind an object // rootCxtExt->rebind(name. // the ORB will be waiting for requests return 0 . // get root NameService objVarNaming = orb->resolve_initial_references("NameService"). // add object reference to counter rootCxtExt->bind(name. PortableServer::POA_var poa . cout << str << "\n" << endl . // Declare naming Context CosNaming::NamingContextExt_var rootCxtExt .

To Do: 1 2 Compile IDL file. the client has to be written. This client can be executed on any machine connected to the server.Section 6 Setting up the Java Client 15 6 Setting up the Java Client To set up a CORBA Client the IDL file has to be compiled. • Find a reference to the naming service. Just make sure the settings are correct.java CountOperations. Also. refer to section 7. 6. cause we already have a C++ server.2 Implement the client To setup the client we have to: • Initialize the ORB. • Create and use the object.java Count.idl no skeletons are required. for an example of the client code.java CountHelper. . on the command line with jidl --no-skeletons Count. you should be able to compile the client code.java CountHolder. For running this example. in order to automaticly generate Client Stubs. See the next page.1 Compile IDL file Compilation of the IDL file with the IDL-compiler as provided with Orbacus (BIN\jidl. 6.java. Now. A directory Counter is created with the following files: _CountStub.exe) generates a number of files needed to successfully implement object transparency.

System.. org.out.resolve_initial_references("NameService").Object objNaming = orb.resolve(path)).CORBA.16 Jan van Gemert 6.println("running client.sum()).util. import org.sum((int)0).FileNotFoundException.out.println("init ORB. else { FileInputStream fis = new FileInputStream(propFile).* .startTime)/1000f) + " msecs").omg.getProperties().. // find object ’The counter’ NameComponent nc = new NameComponent("The counter".: " + e).ORB. java. } catch (Exception e) { System.java code // importing the used Orbacus packages import org.init(args. and the location of the NamingService java.println("!Exception. } } // end setOrbacusProperties() public static void main(String args[]) { try{ System.exists()) propFile = new File(javaHome+File.* . org.println("\n connecting to nameservice. props).println("Avg = "+ ((stopTime .omg.* .close()..currentTimeMillis(). // Increment 1000 times System.""). import java.\n"). System. // Set sum to initial value of 0 System.println("Sum = " + counter. counter.io. if(!propFile. if(!propFile. props.exists()) System.out.out. NamingContext ncRef = NamingContextHelper.println("Setting sum to 0").1 Client.narrow(ncRef.properties").separator+"lib"+File. System.out. // create a counter object Count counter = CountHelper..util.out.out.getProperty("java. // connect to nameservice.currentTimeMillis(). } // Calculate stop time.out.* . for (int i = 0 .ORB orb = org.CORBA. // Calculate Start time long startTime = System. File propFile = new File("orbacus.omg.getPath()). // importing the compiled idl-code public class Client { public static void setOrbacusProperties(java.IOException { String javaHome = System. NameComponent path[] = {nc}.home").properties").2. i < 1000 . print out statistics long stopTime = System.load(fis). } } // end main() } // end class Client .properties").CORBA.CosNaming. // load properties for Orbacus. setOrbacusProperties(props) .\n").out.Properties props) throws java.separator + "orbacus.io.increment().\n").omg.narrow(objNaming).CORBA. import Counter.println("Loading "+propFile. System.println("Incrementing").out. i++ ) { counter.println("Cannot find file: orbacus.io.Properties props = System. get IOR of nameservice System.omg. fis..

. on the port earlier specified (e. 8001). IOR:01494f501600000049444c3a436f756e7465722f436f756e743a312e3000a b3002000000000000004c000000010102501600000070632d6373797330392e77 696e732e7576612e6e6c00ba0424000000abacab31393535343531373937005f5 26f6f74504f410000cafebabe38f309950000000000000000010000007c000000 0170820001000000010000006c00000001000000010001000a000000020001000 30001000400010005000100060001000700010008000100090001000100010520 000100090101000c0000000001010001000100020001000300010004000100050 00100060001000700010008000100090001000100010520000100 On the screen of the Client something appears like: running client.Section 7 Running the example 17 7 Running the example • Run the naming service. Compile the Client. • Run the client. On the screen of the server something appears like: init ORB.exe -OAport 8001 in the OBC_ROOT\BIN directory.. For running this example. • Run the Server. we have to do several things: To Do: 1 2 3 4 Run nameserv.java by typing javac Client. Execute the server project in MSDEV. Be sure to have set your CLASSPATH correctly. Created Count object connecting to namingservice. Setting sum to 0 Incrementing Avg = 1. Run the Client with java Client... connecting to nameservice.188 msecs Sum = 1000 .g.java. Loading orbacus.properties init ORB.

Wiley.18 REFERENCES References [1] R Orfali and D Harkey. Client/Server Programming with Java and CORBA. second edition. . 1998.

.

2000.M. 2000. Color invariance. Cornelissen. University of Amsterdam. van den Boomgaard.J. and H.C.M. Smeulders. A. University of Amsterdam. M. Smeulders. University of Amsterdam.M. Worring.W. and R. [3] J. Technical Report 17. Color and scale: The spatial structure of color images. Geerts. . G. F. [7] A. [6] L. [5] J. A. van den Boomgaard. Gupta. Smeulders. [2] J. Intelligent Sensory Information Systems Group. Cornelissen. Jain. University of Amsterdam. Technical Report 19. 2000. Segmentation of color document images.W. Smeulders.uva. 2000. 2000. Geusebroek. A. University of Amsterdam.W. University of Amsterdam. Intelligent Sensory Information Systems Group. and R. Bergsma.M. Streekstra.uva.M. Technical Report 16. 2000.20 REFERENCES ISIS reports This report is in the series of ISIS technical reports. University of Amsterdam. University of Amsterdam. Velocity estimation of spots in 3d confocal image sequences of living cells. [4] J. Manders. 2000.W. Technical Report 24.science.B. Geerts. You may order copies of the ISIS technical reports from the corresponding author or the series editor. and E. A. Content based image retrieval at the end of the early years. A.W. Geusebroek. Worring.M. Within this series the following titles are available: References [1] J. R. and H.M.nl). Intelligent Sensory Information Systems Group.M. F. [9] J. Intelligent Sensory Information Systems Group. Intelligent Sensory Information Systems Group. [8] C.M. The series editor is Rein van den Boomgaard (reports-isis@science. Technical Report 21. Smeulders. Intelligent Sensory Information Systems Group.W. Technical Report 22.M. van Gemert. Most of the reports can also be found on the web pages of the ISIS group (http://www. Dev. Intelligent Sensory Information Systems Group. Intelligent Sensory Information Systems Group.nl/research/isis). University of Amsterdam. Todoran and M.M. Geusebroek. Intelligent Sensory Information Systems Group. A physical basis for color constancy.M. Technical Report 23. Technical Report 18. A. Technical Report 20. Practical tutorial for using corba. Segmentation of tissue architecture by distance graph matching. 2000. Santini. Smeulders.J. and A. Geusebroek. 2000. Geusebroek.M. Robust autofocusing in microscopy. S.

Sign up to vote on this title
UsefulNot useful