![]() |
![]() |
BEA WebLogic Enterprise 4.2 Developer Center |
![]() HOME | SITE MAP | SEARCH | CONTACT | GLOSSARY | PDF FILES | WHAT'S NEW |
||
![]() GETTING STARTED | TABLE OF CONTENTS | PREVIOUS TOPIC | NEXT TOPIC | INDEX |
The chapter discusses the following topics:
Refer to 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 an additional server application and a BEA TUXEDO application. The Billing server application contains a Readme.txt
in the \wrapper
directory for troubleshooting information and the latest information about using the Wrapper sample application.
How the Wrapper Sample Application Works
Teller
object, which calls the BEA TUXEDO Teller application. The BEA TUXEDO 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 a BEA TUXEDO application in a Weblogic Enterprise (WLE) application. These steps are in addition to the development process outlined in Chapter 3, "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 a BEA TUXEDO application, you need to define an object that interoperates with the BEA TUXEDO application and a factory that creates that object. In the Wrapper sample application, the
You need to add a During the development process, you would add code to the client application to handle the user exception During the development process, you would write the following for the Billing server application:
Figure 6-1 The Wrapper Sample Application
The Development Process for the Wrapper sample application
OMG IDL
Teller
and TellerFactory
objects interact with the BEA TUXEDO Teller application. 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:
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.
The Client Application
Delinquent Account
that the register_for_courses()
operation can raise.
The Server Application
get_balance()
, credit()
, and debit()
operations for the Teller
object. The method implementations need to include the code that does the following:
find_teller()
operation of the TellerFactory
object.
During the development process, you would add the following to the University server application:
TellerFactory
object. The University server application is using the Bootstrap and FactoryFinder objects like a client application would.
For information about writing server applications that wrap BEA TUXEDO applications, see Creating C++ Server Applications.
During the development process, you need to make the following changes to the The UBBCONFIG File
UBBCONFIG
file:
GROUPS
section of the UBBCONFIG
file:
ORA_GRP
, which contains the University server application, the BEA TUXEDO Teller application, and the server application for the University database. This server group allows both the University server application and the BEA TUXEDO Teller application to access the University database.
SERVERS
section of the UBBCONFIG
file. Start the server applications in the following order:
During the development process, you need to define activation and transaction policies for the The ICF File
Teller
and TellerFactory
objects. The Teller
and TellerFactory
objects have the following policies:
Teller
object has an activation policy of process
and a transaction policy of optional
.
TellerFactory
object has an activation policy of process
and a transaction policy of ignore
.
For information about defining activation and transaction policies for CORBA objects, see Creating C++ Server Applications.
Perform the following steps to build the Wrapper sample application:
Building the Wrapper Sample Application
The following sections describe these steps.
Note: Before you can build or run the Wrapper sample application, you need to perform the steps in Chapter 2, "Setting Up Your Environment."
The files for the Wrapper sample application are located in the following directories:
Windows NT
drive
:\
WLEdir
\samples\corba\university
\wrapper
UNIX
/usr/
WLEdir
/samples/corba/university
/wrapper
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 WLE 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:
Windows NT
prompt>attrib -r drive:\
workdirectory
\*.*
UNIX
prompt>chmod u+rw /
workdirectory
/*.*
Use the following command to set the environment variables used to build the client and server applications in the Wrapper sample application:
Windows NT
prompt>setenvw
UNIX
prompt>/bin/ksh
prompt>. ./setenvw.sh
Use the following command to initialize the University database used with the Wrapper sample application:
Windows NT
prompt>nmake -f makefilew.nt initdb
UNIX
prompt>make -f makefilew.mk initdb
Use the following command to load the UBBCONFIG
file:
Windows NT
prompt>tmloadcf -y ubb_w.nt
UNIX
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 WLE 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.
You need to perform the following steps to open the transaction log for the Wrapper sample application:
tmadmin
where
crdl -b
blocks
-z
directorypath
crlog -m SITE1
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 NT:
crdl -b 500 -z c:\mysamples\university\wrapper\TLOG
q
to quit the Interactive Administrative Interface.
During the development process, you would use the buildobjclient
and 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:
Windows NT
prompt>nmake -f makefilew.nt
UNIX
prompt>make -f makefilew.mk
To build the CORBA Java client application:
Windows NT
prompt>nmake -f makefilew.nt javaclient
UNIX
prompt>make -f makefilew.mk javaclient
For information about starting the ActiveX client application, see "Starting the ActiveX Client Application."
For more information about the buildobjclient
and buildobjserver
commands, see the C++ Programming Reference.
Perform the following steps to run the Wrapper sample application:
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:
prompt>tmboot -y
This command starts the following server processes:
TMSYSEVT
The BEA TUXEDO system event broker.
TMFFNAME
The transaction management services, including the NameManager and the FactoryFinder services.
TMIFSRVR
The Interface Repository server process. This server process is used only by ActiveX client applications.
univw_server
The University server process.
tellw_server
The BEA TUXEDO Teller application process.
billw_server
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 performing the following steps:
prompt>tmshutdown
Starting the CORBA C++ Client Application
prompt>univw_client
Enter student id:
prompt, enter any number between 100001 and
100010.
Before you can start the CORBA Java client application, you need to change the value of the Port
and Host
parameters in UnivWApplet.html
to match the host name and port number specified in the ISL
parameter in the UBBCONFIG
file. For example:
<param name=port value=2500>
<param name=host value=BEANIE>
Start the CORBA Java client application in the Wrapper sample application by performing the following steps:
A logon window appears.
prompt>appletviewer UnivWApplet.html
UBBCONFIG
file.
Exceptions appear in the status bar of the Appletviewer window or in the MS-DOS window in which the CORBA Java client application was started.
Note:
For the University sample applications, the task of loading the OMG IDL for the CORBA interfaces into the Interface Repository is automated by the makefile
.
Before you can start the ActiveX client application, you must use the Application Builder to create ActiveX bindings for the CORBA interfaces.
To create an ActiveX binding for a CORBA interface:
The IIOP Listener window appears.
ISL
parameter in the UBBCONFIG
file . You must match exactly
the capitalization used in the UBBCONFIG
file.
The Logon window appears.
UBBCONFIG
file.
The Application Builder window appears. All the CORBA interfaces loaded in the Interface Repository appear in the Services window of the Application Builder.
A confirmation window appears.
The Application Builder creates the following:
DI
modulename_interfacename
. For example, the binding for the Registrar
interface is named DIUniversityW_Registrar
.
\
WLEdir
\TypeLibraries.
The type library file is named DI
modulename_interfacename
.tlb.
Perform the following steps to run the ActiveX client application:
The IIOP Listener window appears.
ISL
parameter in the UBBCONFIG
file. You must match exactly
the capitalization used in the UBBCONFIG
file.
The Logon window appears.
UBBCONFIG
file.
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
The 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.
The CORBA Java client application in the Wrapper sample application allows you to display an account balance.
When you log on to the CORBA Java client application, a Student Account Summary window appears. The Student Account Summary window displays the account balance associated with the student ID used to log on to the CORBA Java client application. When you register for additional courses, the amount in the Balance text box in the Student Account Summary window increases.
To exit the CORBA Java client application, click the Logoff button in the Student Account Summary window, or choose Quit from the File menu.
The ActiveX client application in the Wrapper sample application allows you to display an account balance.
When you log on to the ActiveX client application, a Course Browser window appears. The Course Browser window displays the registered courses and account balance for the student ID used to log on to the ActiveX client application. When you register for additional courses, the amount in the Balance text box in the Course Browser window increases.
To exit the ActiveX client application, choose Exit from the File menu.