For an explanation of concepts associated with CORBA applications and a description of the development process for CORBA applications, see Getting Started with Oracle Tuxedo CORBA Applications.The Basic sample application allows users to browse for available courses and get details on selected courses. Figure 3‑1 illustrates how the Basic sample application works.Figure 3‑1 The Basic Sample Application
Creates object references to the Registrar object. Listing 3‑1 shows the univb.idl file that defines the CORBA interfaces in the Basic sample application. A copy of this file is included in the directory for the Basic sample application.Listing 3‑1 OMG IDL for the Basic Sample Applicationmodule UniversityB
{
typedef unsigned long CourseNumber;
typedef sequence<CourseNumber> CourseNumberList;
struct CourseSynopsis
{
CourseNumber course_number;
string title;
};
typedef sequence<CourseSynopsis> CourseSynopsisList;
interface CourseSynopsisEnumerator
{
CourseSynopsisList get_next_n(
in unsigned long number_to_get,
out unsigned long number_remaining
);
void destroy();
};
typedef unsigned short Days;
const Days MONDAY = 1;
const Days TUESDAY = 2;
const Days WEDNESDAY = 4;
const Days THURSDAY = 8;
const Days FRIDAY = 16;
struct ClassSchedule
{
Days class_days; // bitmask of days
unsigned short start_hour; // whole hours in military time
unsigned short duration; // minutes
};
struct CourseDetails
{
CourseNumber course_number;
double cost;
unsigned short number_of_credits;
ClassSchedule class_schedule;
unsigned short number_of_seats;
string title;
string professor;
string description;
};
typedef sequence<CourseDetails> CourseDetailsList;
interface Registrar
{
CourseSynopsisList
get_courses_synopsis(
in string search_criteria,
in unsigned long number_to_get, // 0 = all
out unsigned long number_remaining,
out CourseSynopsisEnumerator rest
);
CourseDetailsList get_courses_details(in CourseNumberList
courses);
interface RegistrarFactory
{
Registrar find_registrar(
);
};
};
Note: The interface specification defined in OMG IDL is used by the IDL compiler to generate client stubs for the client application and skeletons for the server application. The client stubs are used by the client application for all operation invocations. You use the skeleton, along with the code you write, to create the server application that implements the CORBA objects. For information about generating and using client stubs and skeletons, see Getting Started with Oracle Tuxedo CORBA Applications.During the development process, you would use the idl command to compile the OMG IDL file and produce client stubs and skeletons. This task has been automated in the makefile for the Basic sample application. For a description of the idl command, see the Oracle Tuxedo Command Reference.
• Uses a factory to get an object reference for the Registrar object
• C++ versions of the client application code in the Basic sample application are provided. For information about writing client applications, see Getting Started with Oracle Tuxedo CORBA Applications and Creating CORBA Client Applications.
• The Server object that initializes the University server application and registers a factory for the Registrar object with the Oracle Tuxedo domain.
• The method implementations for the operations on the Registrar, RegistrarFactory, and CourseSynopsisEnumerator objects.During the development process, you use the genicf command to create an Implementation Configuration File (ICF). You then edit the ICF file to define activation and transaction policies for the Registrar, RegistrarFactory, and CourseSynopsisEnumerator objects. For the Basic sample application, the Registrar, RegistrarFactory, and CourseSynopsisEnumerator objects have an activation policy of process and a transaction policy of ignore. An ICF file for the Basic sample application is provided.For information about writing server applications, see Creating CORBA Server Applications.A key part of any CORBA application is the UBBCONFIG file. Although creating a UBBCONFIG file is the task of the administrator, it is important for programmers to understand that the file exists and how the file is used. When system administrators create a configuration file, they are describing the CORBA application using a set of parameters that the Oracle Tuxedo software interprets to create a runnable application.
• The UBBCONFIG file, an ASCII version of the file, created and modified with any editor. “Setting Up Your Environment” describes setting the required parameters in the UBBCONFIG file used by all University sample applications.
• The TUXCONFIG file, a binary version of the UBBCONFIG file created using the tmloadcf command. When the tmloadcf command is executed, the environment variable TUXCONFIG must be set to the name and directory location of the TUXCONFIG file.For information about the UBBCONFIG file and the tmloadcf command, see Setting Up an Oracle Tuxedo Application and the Oracle Tuxedo Command Reference.
5. Load the UBBCONFIG file.
Note: In addition, you need to copy the utils directory into your work directory. The utils directory contains files that set up logging, tracing, and access to the University database.Table 3‑1 lists and describes the files you will use to create the Basic sample application.
The C++ source code for method implementations of the CourseSynopsisEnumerator, Registrar, and RegistrarFactory interfaces. The makefile for the Basic sample application on the UNIX operating system platform. The makefile for the Basic sample application on the Windows operating system platform. oradbconn.cpp and oranoconn.cpp samplesdb.cpp and samplesdb.h unique_id.cpp and unique_id.h samplesdbsql.h and samplesdbsql.pc The SQL for the University database. This file is located in the \utils directory.Use the following command to load the UBBCONFIG file:During the development process, you would use the buildobjclient and buildobjserver commands to build the client and server applications. However, for the Basic sample application, this step has been done for you.The directory for the Basic sample application contains a makefile that builds the client and server sample applications.
•
•
•
•
2. Enter a text string at the Enter search string: prompt. For example, computer. You can enter any combination of uppercase and lowercase letters.
2.
2. To exit the C++ CORBA client application, enter E at the Options prompt.