Table of Contents Previous Next PDF


Using the CORBA Name Service Sample Application

Using the CORBA Name Service Sample Application
This topic includes the following sections:
Note:
Technical support for third party CORBA Java ORBs should be provided by their respective vendors. Oracle Tuxedo does not provide any technical support or documentation for third party CORBA Java ORBs.
How the Name Service Sample Application Works
The CORBA Name Service sample application is a modification of the Simpapp sample application. This sample application provides a CORBA C++ client and server. The Name Service sample application uses a namespace to store the SimpleFactory object. The server application creates the SimpleFactory object and binds the object to the namespace. The client application connects to the namespace, resolves the name of the SimpleFactory object, and then invokes methods on the SimpleFactory. Figure 4‑1 illustrates how the Name Service sample application works.
Figure 4‑1 The Name Service Sample Application
 
 
The Name Service sample application implements the CORBA interfaces listed in Table 4‑1:
 
Listing 4‑1 shows the simple.idl file that defines the CORBA interfaces in the Name Service sample application.
Listing 4‑1 OMG IDL Code for the Name Service Sample Application
#pragma prefix "beasys.com"
interface Simple
{
     //Convert a string to lower case (return a new string)
     string to_lower(in string val);
     //Convert a string to upper case (in place)
     void to_upper(inout string val);
};
interface SimpleFactory
{
     Simple find_simple();
};
 
Building and Running the Name Service Sample Application
To build and run the Name Service sample application, complete the following steps:
1.
2.
3.
4.
Execute the runme command.
Step 1: Copy the Files for the Name Service Sample Application into a Work Directory
Copy the files for the Name Service sample application into a work directory on your local machine. Running the sample application in a work directory allows you to identify the files that are created when the sample is executed. The following sections detail the directory location and sources files for the the Name Service sample application.
CORBA C++ Client and Server Version of the Name Service Sample Application
The files for the Name Service sample application are located in the following directories:
Windows
drive:\tuxdir\samples\corba\cnssimpapp
UNIX
/usr/local/tuxdir/samples/corba/cnssimpapp
Use the files listed in Table 4‑2 to build and run the Name Service sample application.
 
The OMG IDL code that declares the Simple and SimpleFactory interfaces.
The C++ source code that implements the Simple and SimpleFactory methods.
The makefile for the Name Service sample application on UNIX operating systems. This file is used to build the Name Service sample application manually. See the Readme.txt file for additional information. The location of the executable UNIX make command must be defined in the PATH environment variable.
The makefile for the Name Service sample application on the Windows operating system. This makefile can be used directly by the Visual C++ nmake command. This file is used to manually build the Name Service sample application. See the Readme.txt file for more information. The location of the executable Windows nmake command must be defined in the PATH environment variable.
Step 2: Change the Protection Attribute on the Files for the Name Service Sample Application
The files for the sample application are installed with a permission level of read only. Before you can edit or build the files in the Name Service sample application, you must change the protection attribute of the files you copied into your work directory, as follows:
Windows
prompt> attrib -r drive:\workdirectory\*.*
UNIX
1.
2.
ksh prompt> chmod u+w /workdirectory/*.*
On UNIX platforms, you also need to change the permission of runme.ksh to allow execute permission, as follows:
ksh prompt> chmod +x runme.ksh
Step 3: Verify the Settings of the Environment Variables
Before running the Name Service sample application, you need to verify that certain environment variables are defined to correct locations. In most cases, these environment variables are set as part of the installation procedure. Some environment variables are set when you execute the runme command. You need to check the environment variables to ensure they reflect correct information.
Table 4‑3 lists the environment variables required to run the Name Service sample application.
 
Execution of the runme command sets this environment variable to the absolute path name of the current directory. Execute the runme command from the directory to which you copied the sample application files. For example:
Execution of the runme command sets this environment variable to the results directory, subordinate to the location defined by the APPDIR environment variable.
Execution of the runme command sets this environment variable to the directory path and filename of the configuration file.
To verify that the information for the environment variables defined during installation is correct, complete the following steps:
Windows
1.
2.
The Control Panel appears.
3.
The System Properties window appears.
4.
The Environment page appears.
5.
UNIX
ksh prompt> printenv TUXDIR
To change the settings, complete the following steps:
Windows
1.
2.
3.
UNIX
ksh prompt> export TUXDIR=directorypath
Step 4: Execute the runme Command
The runme command completes the following steps end-to-end:
1.
2.
Loads the UBBCONFIG file.
3.
4.
5.
6.
7.
Note:
To build and run the Name Service sample application, enter the runme command, as follows:
Windows
prompt> cd workdirectory
prompt> runme
UNIX
ksh prompt> cd workdirectory
ksh prompt> ./runme.ksh
When the Name Service sample application runs successfully from start to finish, this series of messages is printed:
Testing NameService simpapp
cleaned up
prepared
built
loaded ubb
booted
ran
shutdown
saved results
PASSED
Table 4‑4 lists the files in the work directory generated by the runme command.
 
Generated by the idl command, this file contains the client stubs for the SimpleFactory and Simple interfaces.
Generated by the idl command, this file contains the client definitions of the SimpleFactory and Simple interfaces.
Generated by the idl command, this file contains the server skeletons for the SimpleFactory and Simple interfaces.
Generated by the idl command, this file contains the server definition for the SimpleFactory and Simple interfaces.
A directory created by the runme command, subordinate to the location defined by the APPDIR environment variable.
 
Table 4‑5 lists files in the results directory generated by the runme command.
 
Contains the input that the runme command provides to the Java client application.
Contains the output produced when the runme command executes the Java client application.
Contains the output that is expected when the Java client application is executed by the runme command. The data in the output file is compared to the data in the expected_output file to determine whether or not the test passed or failed.
Contains the output generated by the runme command. If the runme command fails, check this file for errors.
Output from commands generated by the tmboot command, which is executed by the runme command. If the -noredirect JavaServer option is specified in the UBBCONFIG file, the System.err.println method sends the output to the stderr file instead of to the ULOG file.
Output generated by the tmboot command, which is executed by the runme command. If the -noredirect JavaServer option is specified in the UBBCONFIG file, the System.out.println method sends the output to the stdout file instead of to the ULOG file.
Contains filtering and notification rules used by the TMSYSEVT (system event reporting) process. This file is generated by the tmboot command in the runme command.
The UBBCONFIG file for the Java Name Service sample application.
ULOG.date
 

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.