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>`

Collaboration diagram for TAO_AMH_Response_Handler:

[legend]
List of all members.

## Public Methods
| TAO_AMH_Response_Handler (TAO_ServerRequest &server_request)
| Constructor. More...
virtual | ~TAO_AMH_Response_Handler (void)
| Destructor. More...
## Protected Methods
void | _tao_rh_init_reply (void)
| 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. More...
void | _tao_rh_send_reply (void)
| Sends the marshalled reply back to the client. More...
void | _tao_rh_send_exception (CORBA::Exception &ex ACE_ENV_ARG_DECL)
| Send back an exception to the client. More...
## Protected Attributes
TAO_OutputCDR | _tao_out
| The outgoing CDR stream. More...
## 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_Messaging * | mesg_base_
| Pointer to the original message-base. More...
CORBA::ULong | request_id_
| Copy of the request-id of the original Server-Request. More...
TAO_Transport * | transport_
| Handle to transport through which the reply will be sent Copy of transport in original Server_Request. More...
TAO_ORB_Core * | orb_core_
| A pointer to the ORB Core for the context where the request was created. More...
TAO_Service_Context | reply_service_context_
| The reply service context. More...
CORBA::Boolean | argument_flag_
| Alwyas set to true (we always have soemthing to return to the client. More...
CORBA::ULong | exception_type_
| Exception type (will be NO_EXCEPTION in the majority of the cases). More...
Reply_Status | reply_status_
TAO_SYNCH_MUTEX | mutex_
| Mutex to ensure the AMH-RH method call is thread-safe. More...

## 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 | ( | void |  | ) | `[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 | ( | void |  | ) | `[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.

TAO_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.

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.

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:

- AMH_Response_Handler.h
- AMH_Response_Handler.cpp