The topic includes the following sections:
|Notes:||The Oracle Tuxedo CORBA Java client and Oracle Tuxedo CORBA Java client ORB were deprecated in Tuxedo 8.1 and are no longer supported. All Oracle Tuxedo CORBA Java client and Oracle Tuxedo CORBA Java client ORB text references, associated code samples, should only be used to help implement/run third party Java ORB libraries, and for programmer reference only.|
|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.|
In the Wrapper sample application, when a student registers for classes, the student’s account is charged for the classes and the balance of the student’s account is updated. In addition, students can get information about their account balances.
The Wrapper sample application incorporates a ATMI service. The Billing server application contains a
Teller object, which calls the ATMI application Teller. The Teller application performs the following billing operations:
The University database is modified to include account information.
Figure 6-1 illustrates how the Wrapper sample application works.
This section describes the development process required when wrapping an ATMI service in a CORBA application. These steps are in addition to the development process outlined in The Basic Sample Application.
|Note:||The steps in this section have been done for you and are included in the Wrapper sample application.|
When wrapping an ATMI service, you need to define an object that interoperates with the ATMI service and a factory that creates that object. In the Wrapper sample application, the
TellerFactory objects interact with the ATMI service. During the development process, you would define the interfaces of the
Teller and the
TellerFactory objects in Object Management Group (OMG) Interface Definition Language (IDL), as follows:
You need to add a
Balance field to the
StudentDetails structure. Client applications use the
Balance field to show the student’s account balance. A user exception
DelinquentAccount is also added.
During the development process, you would add code to the client application to handle the user exception
Delinquent Account that the
register_for_courses() operation can raise.
During the development process, you would write the following for the Billing server application:
debit()operations for the
Tellerobject. The method implementations need to include the code that does the following:
find_teller()operation of the
TellerFactoryobject and calls the
During the development process, you would add the following to the University server application:
TellerFactoryobject. The University server application is using the Bootstrap and FactoryFinder objects like a client application would.
TellerFactoryobject in the constructor of the servant for the Registrar object. Use the
TellerFactoryobject to create a
register_for_courses()operations for the
Registrarobject, invoke the
debit()operations on the
For information about writing server applications that wrap ATMI services, see Creating CORBA Server Applications.
During the development process, you need to make the following changes to the
GROUPSsection of the
ORA_GRP,which contains the University server application, the Teller application, and the server application for the University database. This server group allows both the University server application and the Teller application to access the University database.
APP_GRP, which contains the Billing server application.
SERVERSsection of the
UBBCONFIGfile. Start the server applications in the following order:
During the development process, you need to define activation and transaction policies for the
TellerFactory objects. The
TellerFactory objects have the following policies:
For information about defining activation and transaction policies for CORBA objects, see Creating CORBA Server Applications.
To build the Wrapper sample application, complete the following steps:
The following sections describe these steps.
|Note:||Before you can build or run the Wrapper sample application, you need to complete the steps in Setting Up Your Environment.|
The files for the Wrapper sample application are located in the following directories:
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.
You will use the files listed in Table 6-1 to create the Wrapper sample application.
During the installation of the Oracle Tuxedo software, the sample application files are marked read-only. Before you can edit the files or build the files in the Wrapper sample application, you need to change the protection of the files you copied into your work directory, as follows:
prompt>attrib -r drive:\
prompt>chmod u+rw /
Use the following command to set the environment variables used to build the client and server applications in the Wrapper sample application:
Use the following command to initialize the University database used with the Wrapper sample application:
prompt>nmake -f makefilew.nt initdb
prompt>make -f makefilew.mk initdb
Use the following command to load the
prompt>tmloadcf -y ubb_w.nt
prompt>tmloadcf -y ubb_w.mk
The build process for the
UBBCONFIG file prompts you for an application password. This password will be used to log on to the client applications. Enter the password and press Enter. You are then prompted to verify the password by entering it again.
The transaction log records the transaction activities in a CORBA application. During the development process, you need to define the location of the transaction log (specified by the
TLOGDEVICE parameter) in the
UBBCONFIG file. For the Wrapper sample application, the transaction log is placed in your work directory.
To open the transaction log for the Wrapper sample application, complete the following steps:
blocks specifies the number of blocks to be allocated for the transaction log, and
directorypath indicates the location of the transaction log. The
directorypath option needs to match the location specified in the
TLOGDEVICE parameter in the
UBBCONFIG file. The following is an example of the command on Windows:
During the development process, you would use the
buildobjserver commands to build the client and server applications. However, for the Wrapper sample application, this step has been done for you. The directory for the Wrapper sample application contains a
makefile that builds the client and server sample applications.
Use the following commands to build the CORBA C++ client and server application in the Wrapper sample application:
prompt>nmake -f makefilew.nt
prompt>make -f makefilew.mk
To run the Wrapper sample application, complete the following steps:
These steps are described in the following sections.
Start the system and sample application server processes in the Wrapper sample application by entering the following command:
This command starts the following server processes:
Before using another sample application, enter the following command to stop the system and sample application server processes:
Start the CORBA C++ client application in the Wrapper sample application by completing the following steps:
The following sections explain how to use the client applications in the Wrapper sample application.
The CORBA C++ client application in the Wrapper sample application has the following additional option:
<B> Display Your Balance
Display Your Balance option displays the account balance associated with the student ID used to log on to the CORBA C++ client application.
To exit the C++ CORBA client application, enter
E at the Options prompt.