CORBA 2.3.3 Programmer's Guide for C++ (NonStop CORBA 2.3.3+)
Table Of Contents
- CORBA 2.3.3 Programmer's Guide for C++
- Legal Notice
- Contents
- About This Guide
- Chapter 1. Introduction to NonStop CORBA Programming
- Chapter 2. NonStop CORBA Administrative Environment
- Chapter 3. Compiling and Building an Application
- Chapter 4. Deploying a NonStop CORBA Application
- Chapter 5. Tracing and Debugging Applications
- Chapter 6. Writing Scalable Applications
- Chapter 7. Managing Transactions
- Chapter 8. Writing Multithreaded Applications
- Chapter 9. Designing Advanced Applications
- Chapter 10. Porting CORBA Applications to NonStop CORBA
- Chapter 11. Writing Wrappers for Legacy Clients and Servers
- Appendix A. Architectural Walkthrough
- Appendix B. Object References
- Appendix C. Servant Reference Counting in NonStop CORBA
- Index
the underlying event framework. To send such requests, the wrapper invokes the services of a client event handler
through the event framework API. The server wrapper acts as a user of a client event handler: in other words, a client
event-handler user.
NonStop CORBA provides various types of client event-handler objects to support transport functions such as I/O
completions and error handling. A wrapper for a TCP/IP socket server should use the client event-handler object that
supports TCP/IP socket I/O (Fw_Sock_Client_EH).
A server wrapper for a legacy TCP/IP server must do the following:
Implement a client event-handler user object, inheriting from Fw_Client_EH_User.1.
Acting as the client event-handler user, create a socket client event-handler object (Fw_Sock_Client_EH) and
associate with the event-handler object as its user.
2.
Invoke the connect() method on the client event handler.3.
When the event handler returns a connect_complete() upcall (indicating a successful connection), compose
a message by invoking the method Fw_Message::get_message(). This method will create a new message if
none are available for recycling.
4.
Use one of the methods in the Fw_Message class to write data into the message. If needed, the event framework
will use multiple message data descriptors (Fw_MDs).
5.
Direct the event handler to send the message by calling Fw_Sock_Client_EH::send_message(). The
event handler will initiate the send operation and return immediately, while the send is still in progress.
6.
The response data is returned from the server by means of data_in() upcalls, one message data descriptor
(Fw_MD) at a time. Retrieve the data from the MDs and assemble it into an appropriate reply to the client.
7.
After all work is completed, invoke the disconnect() method to shut down the connection.8.
Calling Other Types of Legacy Servers
You can write a server wrapper to call on the services of a context-sensitive Pathsend server (nowait) or a Guardian
file-system server (nowait). However, doing so is more complex than the cases described in this manual, and therefore it
is not recommended that you do so without assistance. If you need to integrate one of these types of servers into your
NonStop CORBA application, Compaq recommends that you contact your service provider.
Managing Transactions in Server Wrappers
Requirements for transaction management in a server wrapper depend on whether an OMG Transaction Service
transaction exists between the CORBA client and the server wrapperthat is, whether the wrapper is a CORBA
transactional server.
If the wrapper is a transactional server, the transaction is propagated by the Transaction Service.
If no Transaction Service transaction exists, and the legacy server expects the file system to propagate the transaction, the
server wrapper must begin the transaction. Compaq recommends that the wrapper begin the transaction with the
DCE_BEGIN_TRANSACTION_ procedure. DCE_BEGIN_TRANSACTION_ will suspend the transaction for you
while the thread is out of play, and resume the transaction when the thread is back in play again.
The server wrapper should then perform jacketed (NonStop DCE) or waited I/O calls to the legacy server. The NonStop
CORBA event framework does not propagate transactions.
For further information about DCE_BEGIN_TRANSACTION_ and other NonStop DCE procedures, refer to the
NonStop DCE Application Programming Manual.