Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_AMH_Response_Handler Class Reference

Class representing an Asynchronous-Method-Handling (AMH) ResponseHandler (RH) object. More...

#include <AMH_Response_Handler.h>

Inheritance diagram for TAO_AMH_Response_Handler:

Inheritance graph
[legend]
Collaboration diagram for TAO_AMH_Response_Handler:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_AMH_Response_Handler (TAO_ServerRequest &server_request)
 Constructor.

virtual ~TAO_AMH_Response_Handler (void)
 Destructor.


Protected Methods

void _tao_rh_init_reply (ACE_ENV_SINGLE_ARG_DECL)
void _tao_rh_send_reply (ACE_ENV_SINGLE_ARG_DECL)
 Sends the marshalled reply back to the client.

void _tao_rh_send_exception (CORBA::Exception &ex ACE_ENV_ARG_DECL)
 Send back an exception to the client.


Protected Attributes

TAO_OutputCDR _tao_out
 The outgoing CDR stream.


Private Types

enum  Reply_Status { TAO_RS_UNINITIALIZED, TAO_RS_INITIALIZED, TAO_RS_SENDING, TAO_RS_SENT }

Private Methods

 TAO_AMH_Response_Handler (const TAO_AMH_Response_Handler &)
TAO_AMH_Response_Handler & operator= (const TAO_AMH_Response_Handler &)

Private Attributes

TAO_Pluggable_Messagingmesg_base_
 Pointer to the original message-base.

CORBA::ULong request_id_
 Copy of the request-id of the original Server-Request.

CORBA::Boolean response_expected_
TAO_Transporttransport_
TAO_ORB_Coreorb_core_
TAO_Service_Context reply_service_context_
 The reply service context.

CORBA::Boolean argument_flag_
CORBA::ULong exception_type_
Reply_Status reply_status_
ACE_SYNCH_MUTEX mutex_
 Mutex to ensure the AMH-RH method call is thread-safe.


Detailed Description

Class representing an Asynchronous-Method-Handling (AMH) ResponseHandler (RH) object.

Class encapsulates state required to send a response back to the client independent of the thread that originally created the state on the activation-record. Thus the required state (copied from TAO_Server_Request) is 'stored' on the heap.

One RH is created for every client request and the RH can be used only once i.e., the asynchronous method can be called only once. This class also encapsulates various initialisation and response-sending functionality that is common to all RHs (generated by the IDL compiler). Thus the IDL-compiler has to generate less code which in turn reduces the overall code size for an application.


Member Enumeration Documentation

enum TAO_AMH_Response_Handler::Reply_Status [private]
 

Various states the ResponseHnadler can be in.

These states represent various states the RH can be in and the states are used not only in implementing the 'once-only semantics of RHs, but in making sure well the call thread-safe as well.

Enumeration values:
TAO_RS_UNINITIALIZED 
TAO_RS_INITIALIZED 
TAO_RS_SENDING 
TAO_RS_SENT 


Constructor & Destructor Documentation

TAO_AMH_Response_Handler::TAO_AMH_Response_Handler TAO_ServerRequest   server_request
 

Constructor.

Stores necessary information from a TAO_Server_Request onto the heap

TAO_AMH_Response_Handler::~TAO_AMH_Response_Handler void    [virtual]
 

Destructor.

Releases the transport and in case of an error, sends the appropriate exception back to the client

TAO_AMH_Response_Handler::TAO_AMH_Response_Handler const TAO_AMH_Response_Handler &    [private]
 


Member Function Documentation

void TAO_AMH_Response_Handler::_tao_rh_init_reply ACE_ENV_SINGLE_ARG_DECL    [protected]
 

Sets up the various paramters in anticipation of returning a reply to the client. return/OUT/INOUT arguments are marshalled into the Output stream after this method has been called.

void TAO_AMH_Response_Handler::_tao_rh_send_exception CORBA::Exception &ex    ACE_ENV_ARG_DECL [protected]
 

Send back an exception to the client.

void TAO_AMH_Response_Handler::_tao_rh_send_reply ACE_ENV_SINGLE_ARG_DECL    [protected]
 

Sends the marshalled reply back to the client.

TAO_AMH_Response_Handler& TAO_AMH_Response_Handler::operator= const TAO_AMH_Response_Handler &    [private]
 


Member Data Documentation

TAO_OutputCDR TAO_AMH_Response_Handler::_tao_out [protected]
 

The outgoing CDR stream.

The IDL-generated ResponseHandler implementations used this field to marshal the response. Making it a field instead of a public accessor makes the code in the generated ResponseHandler implementation a lot more readable.

CORBA::Boolean TAO_AMH_Response_Handler::argument_flag_ [private]
 

Alwyas set to true (we always have soemthing to return to the client

CORBA::ULong TAO_AMH_Response_Handler::exception_type_ [private]
 

Exception type (will be NO_EXCEPTION in the majority of the cases).

TAO_Pluggable_Messaging* TAO_AMH_Response_Handler::mesg_base_ [private]
 

Pointer to the original message-base.

ACE_SYNCH_MUTEX TAO_AMH_Response_Handler::mutex_ [private]
 

Mutex to ensure the AMH-RH method call is thread-safe.

TAO_ORB_Core* TAO_AMH_Response_Handler::orb_core_ [private]
 

A pointer to the ORB Core for the context where the request was created.

Reimplemented from CORBA::Object.

TAO_Service_Context TAO_AMH_Response_Handler::reply_service_context_ [private]
 

The reply service context.

Reply_Status TAO_AMH_Response_Handler::reply_status_ [private]
 

CORBA::ULong TAO_AMH_Response_Handler::request_id_ [private]
 

Copy of the request-id of the original Server-Request.

CORBA::Boolean TAO_AMH_Response_Handler::response_expected_ [private]
 

TAO_Transport* TAO_AMH_Response_Handler::transport_ [private]
 

Handle to transport through which the reply will be sent Copy of transport in original Server_Request


The documentation for this class was generated from the following files:
Generated on Wed Jan 14 23:49:16 2004 for TAO_PortableServer by doxygen1.2.18