This describes naming conventions, class hierarchies, the file names and directory structure of generated code and other issues relevant to understanding and using the C++ Expert API.
Member functions described in this section are generated by C++ Expert based on their description in the Contract Repository, which are derived from BEA TUXEDO service definitions. This table shows the relationship between the BEA TUXEDO, Contract Repository, and C++ Expert definitions.
The following table shows relationship between the BEA TUXEDO, the Contract Repository and C++ Expert data types.
The architecture of the application generated by the C++ Expert is built around the Contract Repository metamodel, shown below.
The C++ Expert uses the information from the Contract Repository to generate C++ bindings for each item in the form of Service Request classes and Server Implementation classes. Those elements are mapped to C++ classes in this fashion:
Figure 4-1 Contract Repository Metamodel
There are two types of classes supplied with the C++ Expert:
C++ Expert Classes and Naming Conventions
All of the classes supplied with the C++ Expert are contained in the BEATuxBldr namespace.
When we refer to a class with a derived name, the derived part is italicized and enumerated. For example, a Generated Server class takes it's name from the module where it is implemented and would be referred to as the
Naming Generated Classes
Module1Srv class or object.
This convention is used in the figures that follow and throughout this document.
The following diagram shows the hierarchy of classes within the BEATuxBldr namespace. Individual exception classes are shown in a separate diagram.
The following figure shows the exception class hierarchy:
All user defined, operation specific exceptions are sub-classes of All BEA TUXEDO errors are encapsulated in sub-classes of The server application can throw user-specified exceptions, which are relayed to the client application. Exceptions derived from Exceptions that are sub-classed from
Note:
In order make exception handling vendor-independent, the C++ Expert generates exception objects and throws them by a pointer to the object, rather than by value. Therefore, C++ Expert exceptions must be caught by the client application via pointer, rather than by reference. The client is also responsible for deleting them.
This section describes the files generated by the C++ Expert, and where they can be found.
The C++ Expert places its generated class header and source files,
The The The The The The The The The The The The The files listed below can be moved to the client platform so that client applications can request services defined in this interface:
The BEATuxBldr Namespace
Figure 4-2 BEATuxBldr namespace
Exception Classes
Figure 4-3 Exception Hierarchy, within the BEATuxBldr namespace
AppException.
TuxException. Errors relating to ATMI calls are encapsulated in AtmiException, and errors relating to FML buffer handling operations are encapsulated in FmlException. Client applications requesting a BEA TUXEDO service must be prepared to handle TuxException or handle AtmiException and FmlException individually, in addition to any user specified exceptions for the operations.
TuxException hierarchy are raised from the C++ Expert generated code and user programs are not expected to raise them on their own.
TransactionException are thrown by operations on Transaction. These exceptions correspond to the error codes returned by functions defined in the Tx Transaction Demarcation Specification. A brief text description of the exception is returned by the GetMessage member function of each class.
Generated Files
Directory Structure
make files and FML field table files in a directory structure determined by the name of the project, individual modules and interfaces and the Contract Repository contents. This structure descends from the project root directory, which is specified by the user on the Generate Framework Classes tab of the Settings dialog. A sample of this structures shown in the following figure:
Figure 4-4 Sample Directory Structure
ProjectRoot directory can be specified on the Generate Settings window.
Project1.FML file contains the FML field table, generated by the Generate FML Field Tables command. The value of Project1 can be specified on the Generate Settings window. The default name is FMLFieldTableFile.
Module1 directory contains all the generated files associated with the first module.
BEATuxBldr.h and BEATuxBldr.cpp files contain all classes and definitions supplied with the C++ Expert.
Module1.mak file contains the generated make declarations and targets for the server and the test client.
Module1.h file contains the name space definitions that correspond to the module.
Module1_tst.cpp file contains the code generated for the test client described in the Testing Default Service Implementations section.
Module1Srv.h and Module1Srv.cpp files contain the class definition and member functions used for server start-up, shut down and Resource Manager access. Default implementations of them are provided, but you can extend both the interface and the default implementation independently.
Interface1.h and Interface1.cpp files contains the class definition and member functions used for the remote object used by the client to access services.
Interface1Impl.h and Interface1Impl.h files contains the class definition and member functions used for implementing BEA TUXEDO services. The body of a member function is left blank, to be provided by the server application developer, when you do not choose to generate operation test logic.
Interface1Skel.cpp file contains the global scope C++ function with C linkage used by the BEA TUXEDO framework.
Module1_Interface1.h and Module1_Interface1.cpp contains the class definition and member functions which is used as the base class for the Interface1 and Interface1Impl derived classes.
FMLFieldTableFile.fml
All the interfaces in a single module are contained in a single BEA TUXEDO server executable. When the C++ Expert generates code for a module selected in the Main Window, a
Make files
make file is also generated. The name of the generated make file based on the module name and the current platform:
| Platform | File name |
|---|---|
|
UNIX |
|
|
Windows NT |
|
The Resource Manager (if any), the C++ compiler, and compilation flags used in the Elements in the Contract Repository can be mapped to FML fields. Users will be able to enter FML field names when they create elements in the repository using the Repository Editor. Uniqueness of these field names is ensured by the repository. The repository also maintains a mapping between these field names and FML field identifier values. The C++ Expert uses this mapping to generate a FML field table file for all the elements in the repository. Using the BEA TUXEDO The This file is generated for the BEA TUXEDO Builder Configuration Expert and placed in the Each line of this text file contains information about the Resource Manager used by the server (if any), the name of the server executable and the module for which the server is constructed.
make file can be specified on the Makefile Settings window. The generated make file is placed in the directory created for each module. While the Confirm Selection window is displayed, you can also override the default Resource Manager and Server name settings on a module by module basis.
FML Field Table File
mkfldhdr utility, a header file is generated from the field table file and used in all the generated server and client files.
make file has rules for compiling the files generated by the C++ Expert. Default rules are generated for compiling the user defined code in the implementation files (refer to Listing 4-4, Interface1Impl.h and Interface1Impl.cpp) and for building the servers. The user can edit the make file to customize the default rules.
The gservers.lst File
ProjectRoot directory (see Figure 4-4, in the Sample Directory Structure section). The ProjectRoot directory can be specified on the Generate Settings window.