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

TAO_ServerRequest Class Reference

Class representing a ServerRequest object. More...

#include <TAO_Server_Request.h>

Collaboration diagram for TAO_ServerRequest:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, TAO_InputCDR &input, TAO_OutputCDR &output, TAO_Transport *transport, TAO_ORB_Core *orb_core)
 TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, CORBA::ULong request_id, CORBA::Boolean response_expected, CORBA::Boolean deferred_flag, TAO_ObjectKey &object_key, const char *operation, TAO_OutputCDR &output, TAO_Transport *transport, TAO_ORB_Core *orb_core, int &parse_error)
virtual ~TAO_ServerRequest (void)
 Destructor. More...

CORBA::ORB_ptr orb (void)
 Return the underlying ORB. More...

TAO_ORB_Coreorb_core (void)
 Return the ORB core pointer member. More...

void init_reply (void)
 Start a Reply message. More...

TAO_InputCDRincoming (void)
 Retrieve the incoming stream. More...

TAO_OutputCDRoutgoing (void)
 Retrieve the outgoing stream. More...

CORBA::Boolean response_expected (void) const
 Is the response expected? More...

CORBA::Boolean deferred_reply (void) const
 Should the reply be deferred? More...

void response_expected (CORBA::Boolean response)
 Set the response expected flag. More...

CORBA::Boolean sync_with_server (void) const
 Should we return before dispatching the servant? More...

void sync_with_server (CORBA::Boolean sync_flag)
 Set the sync_with_server flag. More...

void send_no_exception_reply (void)
 Used with reliable oneway requests. More...

TAO_ObjectKeyobject_key (void)
TAO_Service_Contextrequest_service_context (void)
 Return the TAO_Service_Context. More...

TAO_Service_Contextreply_service_context (void)
TAO_Transporttransport ()
 Return the underlying transport. More...

void forward_location (CORBA::Object_ptr forward_reference)
CORBA::Object_ptr forward_location (void)
 Get the forward_location. More...

CORBA::ULong exception_type (void)
 Get the exception type. More...

void exception_type (CORBA::ULong except_type)
 Set the exception type. More...

void requesting_principal (const CORBA_OctetSeq &principal)
 Set the requesting principal. More...

TAO_Tagged_Profileprofile (void)
 Return the reference to the tagged profile. More...

void tao_send_reply (void)
void tao_send_reply_exception (CORBA::Exception &)
void is_dsi (void)
 Set the boolean member to 1. More...

void dsi_nvlist_align (ptr_arith_t alignment)
 Set the member. More...

void argument_flag (CORBA::Boolean flag)
 Get/Set operations for the argument_flag. More...

CORBA::Boolean argument_flag (void)
size_t & interceptor_count (void)
 Return a reference to the number of interceptors pushed on to the current interceptor flow stack. More...

TAO_PICurrent_Implrs_pi_current (void)
 Return a reference to the "request scope" PICurrent object. More...

Request attributes.
const char * operation (void) const
 Return the operation name. More...

void operation (const char *operation, size_t length, int release)
 Set the operation name. More...

size_t operation_length (void) const
 Return the length of the operation. More...

IOP::ServiceContextListrequest_service_info (void)
IOP::ServiceContextListreply_service_info (void)
CORBA::ULong request_id (void)
void request_id (CORBA::ULong req)

Private Attributes

TAO_Pluggable_Messagingmesg_base_
ACE_CString operation_
 Operation name. More...

CORBA::Object_var forward_location_
TAO_InputCDRincoming_
 Incoming stream. More...

TAO_OutputCDRoutgoing_
 Outgoing stream. More...

TAO_Transporttransport_
 Transport class. More...

CORBA::Boolean response_expected_
 0: oneway (SYNC_NONE or SYNC_WITH_TRANSPORT) 1: twoway, or oneway (SYNC_WITH_SERVER or SYNC_WITH_TARGET). More...

CORBA::Boolean deferred_reply_
CORBA::Boolean sync_with_server_
 1: oneway (SYNC_WITH_SERVER) 0: anything else. More...

CORBA::ULong exception_type_
 Exception type (will be NO_EXCEPTION in the majority of the cases). More...

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

TAO_Service_Context request_service_context_
 Service Context info. More...

TAO_Service_Context reply_service_context_
CORBA::ULong request_id_
 Unique identifier for a request. More...

TAO_Tagged_Profile profile_
 The tagged profile that has the addressing information. More...

CORBA_OctetSeq_var requesting_principal_
 Identifies the requester. More...

CORBA::Boolean is_dsi_
 Did we get passed to a CORBA::ServerRequest? More...

ptr_arith_t dsi_nvlist_align_
 Used to pad CDR stream if we have used DSI. More...

CORBA::Boolean argument_flag_
size_t interceptor_count_
 The number of interceptors pushed on to the current interceptor flow stack. More...

TAO_PICurrent_Impl rs_pi_current_
 The "Request Scope Current" (RSC) object, as required by Portable Interceptors. More...


Friends

class TAO_AMH_Response_Handler
 Declare TAO_AMH_Response_Handler a friend. More...


Detailed Description

Class representing a ServerRequest object.

Encapsulates CDR, transport and pluggable messaging components on the server side.

Definition at line 53 of file TAO_Server_Request.h.


Constructor & Destructor Documentation

TAO_ServerRequest::TAO_ServerRequest TAO_Pluggable_Messaging   mesg_base,
TAO_InputCDR   input,
TAO_OutputCDR   output,
TAO_Transport   transport,
TAO_ORB_Core   orb_core
 

Definition at line 51 of file TAO_Server_Request.cpp.

References ACE_FUNCTION_TIMEPROBE, and TAO_GIOP_NO_EXCEPTION.

00056   : mesg_base_ (mesg_base),
00057     operation_ (),
00058     incoming_ (&input),
00059     outgoing_ (&output),
00060     // transport already duplicated in
00061     // TAO_Transport::process_parsed_messages ()
00062     transport_(transport),
00063     response_expected_ (0),
00064     deferred_reply_ (0),
00065     sync_with_server_ (0),
00066     // @@ We shouldn't be using GIOP specific types here. Need to be revisited.
00067     exception_type_ (TAO_GIOP_NO_EXCEPTION),
00068     orb_core_ (orb_core),
00069     request_id_ (0),
00070     profile_ (orb_core),
00071     requesting_principal_ (0),
00072     is_dsi_ (0),
00073     dsi_nvlist_align_ (0),
00074     argument_flag_ (1)
00075 #if TAO_HAS_INTERCEPTORS == 1
00076   , interceptor_count_ (0)
00077   , rs_pi_current_ ()
00078 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00079 {
00080   ACE_FUNCTION_TIMEPROBE (TAO_SERVER_REQUEST_START);
00081   // No-op.
00082 }

TAO_ServerRequest::TAO_ServerRequest TAO_Pluggable_Messaging   mesg_base,
CORBA::ULong    request_id,
CORBA::Boolean    response_expected,
CORBA::Boolean    deferred_flag,
TAO_ObjectKey   object_key,
const char *    operation,
TAO_OutputCDR   output,
TAO_Transport   transport,
TAO_ORB_Core   orb_core,
int &    parse_error
 

Definition at line 85 of file TAO_Server_Request.cpp.

References TAO_Tagged_Profile::object_key, profile_, and TAO_GIOP_NO_EXCEPTION.

00095   : mesg_base_ (mesg_base),
00096     operation_ (operation),
00097     incoming_ (0),
00098     outgoing_ (&output),
00099     // transport already duplicated in
00100     // TAO_Transport::process_parsed_messages ()
00101     transport_ (transport),
00102     response_expected_ (response_expected),
00103     deferred_reply_ (deferred_reply),
00104     sync_with_server_ (0),
00105     exception_type_ (TAO_GIOP_NO_EXCEPTION),
00106     orb_core_ (orb_core),
00107     request_id_ (request_id),
00108     profile_ (orb_core),
00109     requesting_principal_ (0),
00110     is_dsi_ (0),
00111     dsi_nvlist_align_ (0),
00112     argument_flag_ (1)
00113 #if TAO_HAS_INTERCEPTORS == 1
00114   , interceptor_count_ (0)
00115   , rs_pi_current_ ()
00116 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00117 {
00118   this->profile_.object_key (object_key);
00119   parse_error = 0;
00120 }

TAO_ServerRequest::~TAO_ServerRequest void    [virtual]
 

Destructor.

Definition at line 122 of file TAO_Server_Request.cpp.

00123 {
00124 }


Member Function Documentation

ACE_INLINE CORBA::Boolean TAO_ServerRequest::argument_flag void   
 

Definition at line 180 of file TAO_Server_Request.i.

References argument_flag_.

00181 {
00182   return this->argument_flag_;
00183 }

ACE_INLINE void TAO_ServerRequest::argument_flag CORBA::Boolean    flag
 

Get/Set operations for the argument_flag.

Definition at line 186 of file TAO_Server_Request.i.

References argument_flag_.

00187 {
00188   this->argument_flag_ = flag;
00189 }

ACE_INLINE CORBA::Boolean TAO_ServerRequest::deferred_reply void    const
 

Should the reply be deferred?

Definition at line 52 of file TAO_Server_Request.i.

References deferred_reply_.

00053 {
00054   return this->deferred_reply_;
00055 }

ACE_INLINE void TAO_ServerRequest::dsi_nvlist_align ptr_arith_t    alignment
 

Set the member.

Definition at line 174 of file TAO_Server_Request.i.

References dsi_nvlist_align_, and ptr_arith_t.

00175 {
00176   this->dsi_nvlist_align_ = alignment;
00177 }

ACE_INLINE void TAO_ServerRequest::exception_type CORBA::ULong    except_type
 

Set the exception type.

Definition at line 162 of file TAO_Server_Request.i.

References exception_type_.

00163 {
00164   this->exception_type_ = except_type;
00165 }

ACE_INLINE CORBA::ULong TAO_ServerRequest::exception_type void   
 

Get the exception type.

Definition at line 156 of file TAO_Server_Request.i.

References exception_type_.

00157 {
00158   return this->exception_type_;
00159 }

ACE_INLINE CORBA::Object_ptr TAO_ServerRequest::forward_location void   
 

Get the forward_location.

Definition at line 150 of file TAO_Server_Request.i.

00151 {
00152   return CORBA::Object::_duplicate (this->forward_location_.in ());
00153 }

ACE_INLINE void TAO_ServerRequest::forward_location CORBA::Object_ptr    forward_reference
 

Set the reference to the object the request should be forwarded to. This reference will only be used if set prior to calling init_reply().

Definition at line 143 of file TAO_Server_Request.i.

References forward_location_.

00144 {
00145   this->forward_location_ =
00146     CORBA::Object::_duplicate (forward_reference);
00147 }

ACE_INLINE TAO_InputCDR & TAO_ServerRequest::incoming void   
 

Retrieve the incoming stream.

Definition at line 11 of file TAO_Server_Request.i.

References incoming_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00012 {
00013   return *this->incoming_;
00014 }

void TAO_ServerRequest::init_reply void   
 

Start a Reply message.

Definition at line 133 of file TAO_Server_Request.cpp.

References ACE_DEBUG, ACE_TEXT, argument_flag_, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Transport::assign_translators, dsi_nvlist_align_, TAO_Pluggable_Reply_Params_Base::dsi_nvlist_align_, exception_type_, forward_location_, TAO_Pluggable_Messaging::generate_reply_header, is_dsi_, TAO_Pluggable_Reply_Params_Base::is_dsi_, CORBA::is_nil, LM_DEBUG, mesg_base_, outgoing_, TAO_Pluggable_Reply_Params_Base::reply_status_, request_id_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_Pluggable_Reply_Params_Base::service_context_notowned, TAO_GIOP_NO_EXCEPTION, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD, TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION, and transport_.

00134 {
00135   // Construct our reply generator.
00136   TAO_Pluggable_Reply_Params_Base reply_params;
00137 
00138   // We put all the info that we have in to this <reply_params> and
00139   // call the <write_reply_header> in the
00140   // pluggable_messaging_interface. One point to be noted however is
00141   // that, it was the pluggable_messaging classes who created us and
00142   // delegated us to do work on its behalf. But we would be calling
00143   // back. As we dont have a LOCK or any such things we can call
00144   // pluggable_messaging guys again. We would be on the same thread of
00145   // invocation. So *theoratically* there should not be a problem.
00146   reply_params.request_id_ = this->request_id_;
00147   reply_params.is_dsi_ = this->is_dsi_;
00148   reply_params.dsi_nvlist_align_ = this->dsi_nvlist_align_;
00149 
00150   // Send back the reply service context.
00151   reply_params.service_context_notowned (&this->reply_service_info ());
00152 
00153   // Are we going to marshall any data with the reply?
00154   reply_params.argument_flag_ = this->argument_flag_;
00155 
00156   // Forward exception only.
00157   if (!CORBA::is_nil (this->forward_location_.in ()))
00158     {
00159       reply_params.reply_status_ = TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
00160     }
00161   // Any exception at all.
00162   else if (this->exception_type_ == TAO_GIOP_NO_EXCEPTION)
00163     {
00164       reply_params.reply_status_ = TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
00165     }
00166   else
00167     {
00168       reply_params.reply_status_ = this->exception_type_;
00169     }
00170 
00171   // Construct a REPLY header.
00172   this->mesg_base_->generate_reply_header (*this->outgoing_,
00173                                            reply_params);
00174 
00175   // Finish the GIOP Reply header, then marshal the exception.
00176   if (reply_params.reply_status_ == TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD)
00177     {
00178       // Marshal the forward location pointer.
00179       CORBA::Object_ptr object_ptr = this->forward_location_.in ();
00180 
00181       if ((*this->outgoing_ << object_ptr) == 0)
00182         {
00183           ACE_DEBUG ((LM_DEBUG,
00184                       ACE_TEXT ("TAO_GIOP_ServerRequest::marshal - ")
00185                       ACE_TEXT ("encoding forwarded objref failed\n")));
00186         }
00187     }
00188   this->transport_->assign_translators (0,this->outgoing_);
00189 }

size_t& TAO_ServerRequest::interceptor_count void   
 

Return a reference to the number of interceptors pushed on to the current interceptor flow stack.

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

ACE_INLINE void TAO_ServerRequest::is_dsi void   
 

Set the boolean member to 1.

Definition at line 168 of file TAO_Server_Request.i.

References is_dsi_.

00169 {
00170   this->is_dsi_ = 1;
00171 }

ACE_INLINE TAO_ObjectKey & TAO_ServerRequest::object_key void   
 

Definition at line 83 of file TAO_Server_Request.i.

References TAO_Tagged_Profile::object_key, and profile_.

00084 {
00085   return this->profile_.object_key ();
00086 }

ACE_INLINE void TAO_ServerRequest::operation const char *    operation,
size_t    length,
int    release
 

Set the operation name.

Definition at line 29 of file TAO_Server_Request.i.

References operation, and operation_.

00032 {
00033   if (length == 0)
00034     this->operation_.set (operation, release);
00035   else
00036     this->operation_.set (operation, length, release);
00037 }

ACE_INLINE const char * TAO_ServerRequest::operation void    const
 

Return the operation name.

Definition at line 23 of file TAO_Server_Request.i.

References operation_.

Referenced by operation, TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00024 {
00025   return this->operation_.c_str ();
00026 }

ACE_INLINE size_t TAO_ServerRequest::operation_length void    const
 

Return the length of the operation.

Definition at line 40 of file TAO_Server_Request.i.

References operation_.

00041 {
00042   return this->operation_.length ();
00043 }

CORBA::ORB_ptr TAO_ServerRequest::orb void   
 

Return the underlying ORB.

Definition at line 127 of file TAO_Server_Request.cpp.

References TAO_ORB_Core::orb, and orb_core_.

00128 {
00129   return this->orb_core_->orb ();
00130 }

ACE_INLINE TAO_ORB_Core * TAO_ServerRequest::orb_core void   
 

Return the ORB core pointer member.

Definition at line 5 of file TAO_Server_Request.i.

References orb_core_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_PICurrent_Guard::TAO_PICurrent_Guard.

00006 {
00007   return this->orb_core_;
00008 }

ACE_INLINE TAO_OutputCDR & TAO_ServerRequest::outgoing void   
 

Retrieve the outgoing stream.

Definition at line 17 of file TAO_Server_Request.i.

References outgoing_.

00018 {
00019   return *this->outgoing_;
00020 }

ACE_INLINE TAO_Tagged_Profile & TAO_ServerRequest::profile void   
 

Return the reference to the tagged profile.

Definition at line 137 of file TAO_Server_Request.i.

References profile_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00138 {
00139   return this->profile_;
00140 }

ACE_INLINE TAO_Service_Context & TAO_ServerRequest::reply_service_context void   
 

Definition at line 95 of file TAO_Server_Request.i.

References reply_service_context_.

Referenced by reply_service_info.

00096 {
00097   return this->reply_service_context_;
00098 }

ACE_INLINE IOP::ServiceContextList & TAO_ServerRequest::reply_service_info void   
 

Todo:
This two methods should go away.

Definition at line 107 of file TAO_Server_Request.i.

References reply_service_context, and TAO_Service_Context::service_info.

00108 {
00109   return this->reply_service_context ().service_info ();
00110 }

ACE_INLINE void TAO_ServerRequest::request_id CORBA::ULong    req
 

Definition at line 125 of file TAO_Server_Request.i.

References request_id_.

00126 {
00127   this->request_id_ = req;
00128 }

ACE_INLINE CORBA::ULong TAO_ServerRequest::request_id void   
 

Definition at line 119 of file TAO_Server_Request.i.

References request_id_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00120 {
00121   return this->request_id_;
00122 }

ACE_INLINE TAO_Service_Context & TAO_ServerRequest::request_service_context void   
 

Return the TAO_Service_Context.

Definition at line 89 of file TAO_Server_Request.i.

References request_service_context_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context, TAO_Codeset_Manager::process_service_context, and request_service_info.

00090 {
00091   return this->request_service_context_;
00092 }

ACE_INLINE IOP::ServiceContextList & TAO_ServerRequest::request_service_info void   
 

Todo:
This two methods should go away.

Definition at line 101 of file TAO_Server_Request.i.

References request_service_context, and TAO_Service_Context::service_info.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00102 {
00103   return this->request_service_context ().service_info ();
00104 }

ACE_INLINE void TAO_ServerRequest::requesting_principal const CORBA_OctetSeq   principal
 

Set the requesting principal.

Note:
Deprecated in CORBA 2.4

Definition at line 131 of file TAO_Server_Request.i.

References requesting_principal_.

Referenced by TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00132 {
00133   this->requesting_principal_ = principal;
00134 }

ACE_INLINE void TAO_ServerRequest::response_expected CORBA::Boolean    response
 

Set the response expected flag.

Definition at line 58 of file TAO_Server_Request.i.

References response_expected_.

00059 {
00060   this->response_expected_ = response;
00061 }

ACE_INLINE CORBA::Boolean TAO_ServerRequest::response_expected void    const
 

Is the response expected?

Definition at line 46 of file TAO_Server_Request.i.

References response_expected_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00047 {
00048   return this->response_expected_;
00049 }

TAO_PICurrent_Impl& TAO_ServerRequest::rs_pi_current void   
 

Return a reference to the "request scope" PICurrent object.

Referenced by TAO_PICurrent_Guard::TAO_PICurrent_Guard.

void TAO_ServerRequest::send_no_exception_reply void   
 

Used with reliable oneway requests.

Definition at line 192 of file TAO_Server_Request.cpp.

References ACE_ERROR, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, dsi_nvlist_align_, TAO_Pluggable_Reply_Params_Base::dsi_nvlist_align_, TAO_Pluggable_Messaging::generate_reply_header, is_dsi_, TAO_Pluggable_Reply_Params_Base::is_dsi_, TAO_Unbounded_Base_Sequence::length, LM_ERROR, mesg_base_, TAO_Pluggable_Reply_Params_Base::reply_status_, request_id_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_Transport::send_message, TAO_Pluggable_Reply_Params_Base::service_context_notowned, TAO_Pluggable_Reply_Params_Base::svc_ctx_, TAO_GIOP_NO_EXCEPTION, TAO_Transport::TAO_REPLY, and transport_.

00193 {
00194   // Construct our reply generator.
00195   TAO_Pluggable_Reply_Params_Base reply_params;
00196   reply_params.request_id_ = this->request_id_;
00197   reply_params.is_dsi_ = this->is_dsi_;
00198   reply_params.dsi_nvlist_align_ = this->dsi_nvlist_align_;
00199 
00200   // Change this to pass back the same thing we received, as well as
00201   // leave a comment why this is important!
00202   reply_params.svc_ctx_.length (0);
00203 
00204   // Send back the reply service context.
00205   reply_params.service_context_notowned (&this->reply_service_info ());
00206 
00207   reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION;
00208 
00209   // No data anyway.
00210   reply_params.argument_flag_ = 0;
00211 
00212   // Construct a REPLY header.
00213   this->mesg_base_->generate_reply_header (*this->outgoing_,
00214                                            reply_params);
00215 
00216   // Send the message.
00217   int result = this->transport_->send_message (*this->outgoing_,
00218                                                0,
00219                                                TAO_Transport::TAO_REPLY);
00220 
00221   if (result == -1)
00222     {
00223       if (TAO_debug_level > 0)
00224         {
00225           // No exception but some kind of error, yet a response
00226           // is required.
00227           ACE_ERROR ((
00228                       LM_ERROR,
00229                       ACE_TEXT ("TAO: (%P|%t) %p: cannot send NO_EXCEPTION reply\n"),
00230                       ACE_TEXT ("TAO_GIOP_ServerRequest::send_no_exception_reply")
00231                       ));
00232         }
00233     }
00234 }

ACE_INLINE void TAO_ServerRequest::sync_with_server CORBA::Boolean    sync_flag
 

Set the sync_with_server flag.

Definition at line 70 of file TAO_Server_Request.i.

References sync_with_server_.

00071 {
00072   this->sync_with_server_ = sync_flag;
00073 }

ACE_INLINE CORBA::Boolean TAO_ServerRequest::sync_with_server void    const
 

Should we return before dispatching the servant?

Definition at line 64 of file TAO_Server_Request.i.

References sync_with_server_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00065 {
00066   return this->sync_with_server_;
00067 }

void TAO_ServerRequest::tao_send_reply void   
 

Definition at line 237 of file TAO_Server_Request.cpp.

References ACE_ERROR, ACE_TEXT, LM_ERROR, TAO_Transport::send_message, TAO_Transport::TAO_REPLY, and transport_.

00238 {
00239   int result = this->transport_->send_message (*this->outgoing_,
00240                                                0,
00241                                                TAO_Transport::TAO_REPLY);
00242   if (result == -1)
00243     {
00244       if (TAO_debug_level > 0)
00245         {
00246           // No exception but some kind of error, yet a response
00247           // is required.
00248           ACE_ERROR ((LM_ERROR,
00249                       ACE_TEXT ("TAO: (%P|%t) %p: cannot send reply\n"),
00250                       ACE_TEXT ("TAO_ServerRequest::tao_send_reply")));
00251 
00252         }
00253     }
00254 }

void TAO_ServerRequest::tao_send_reply_exception CORBA::Exception  
 

Definition at line 257 of file TAO_Server_Request.cpp.

References ACE_ERROR, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Transport::assign_translators, TAO_ORB_Parameters::cdr_memcpy_tradeoff, ACE_CDR::DEFAULT_BUFSIZE, TAO_Unbounded_Base_Sequence::length, LM_ERROR, mesg_base_, orb_core_, TAO_ORB_Core::orb_params, TAO_ORB_Core::output_cdr_dblock_allocator, TAO_ORB_Core::output_cdr_msgblock_allocator, TAO_Pluggable_Reply_Params_Base::reply_status_, request_id_, TAO_Pluggable_Reply_Params_Base::request_id_, response_expected_, TAO_Transport::send_message, TAO_Pluggable_Reply_Params_Base::service_context_notowned, TAO_Pluggable_Reply_Params_Base::svc_ctx_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, TAO_GIOP_SYSTEM_EXCEPTION, TAO_GIOP_USER_EXCEPTION, TAO_Transport::TAO_REPLY, and transport_.

00258 {
00259   //  int result = 0;
00260   if (this->response_expected_)
00261     {
00262       // A copy of the reply parameters
00263       TAO_Pluggable_Reply_Params_Base reply_params;
00264 
00265       reply_params.request_id_ = this->request_id_;
00266       reply_params.svc_ctx_.length (0);
00267 
00268       // Send back the reply service context.
00269       reply_params.service_context_notowned (&this->reply_service_info ());
00270 
00271       // We are going to send some data
00272       reply_params.argument_flag_ = 1;
00273 
00274       // Make a default reply status
00275       reply_params.reply_status_ = TAO_GIOP_USER_EXCEPTION;
00276 
00277       // Check whether we are able to downcast the exception
00278       if (CORBA::SystemException::_downcast (&ex) != 0)
00279         {
00280           reply_params.reply_status_ = TAO_GIOP_SYSTEM_EXCEPTION;
00281         }
00282 
00283       // Create a new output CDR stream
00284 #if defined(ACE_HAS_PURIFY)
00285       // Only inititialize the buffer if we're compiling with Purify.
00286       // Otherwise, there is no real need to do so, especially since
00287       // we can avoid the initialization overhead at run-time if we
00288       // are not compiling with Purify support.
00289       char repbuf[ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
00290 #else
00291       char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
00292 #endif /* ACE_HAS_PURIFY */
00293       TAO_OutputCDR output (repbuf,
00294                             sizeof repbuf,
00295                             TAO_ENCAP_BYTE_ORDER,
00296                             this->orb_core_->output_cdr_buffer_allocator (),
00297                             this->orb_core_->output_cdr_dblock_allocator (),
00298                             this->orb_core_->output_cdr_msgblock_allocator (),
00299                             this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
00300                             TAO_DEF_GIOP_MAJOR,
00301                             TAO_DEF_GIOP_MINOR);
00302 
00303       this->transport_->assign_translators(0,&output);
00304       // Make the reply message
00305       if (this->mesg_base_->generate_exception_reply (*this->outgoing_,
00306                                                       reply_params,
00307                                                       ex) == -1)
00308         {
00309           ACE_ERROR ((LM_ERROR,
00310                       ACE_TEXT ("TAO: (%P|%t|%N|%l): ")
00311                       ACE_TEXT ("could not make exception reply\n")));
00312 
00313         }
00314 
00315       // Send the message
00316       if (this->transport_->send_message (*this->outgoing_,
00317                                           0,
00318                                           TAO_Transport::TAO_REPLY) == -1)
00319         {
00320           ACE_ERROR ((LM_ERROR,
00321                       ACE_TEXT ("TAO: (%P|%t|%N|%l):  ")
00322                       ACE_TEXT ("could not send exception reply\n")));
00323         }
00324     }
00325   else if (TAO_debug_level > 0)
00326     {
00327       // It is unfotunate that an exception (probably a system
00328       // exception) was thrown by the upcall code (even by the
00329       // user) when the client was not expecting a response.
00330       // However, in this case, we cannot close the connection
00331       // down, since it really isn't the client's fault.
00332 
00333       ACE_ERROR ((LM_ERROR,
00334                   ACE_TEXT ("(%P|%t) exception thrown ")
00335                   ACE_TEXT ("but client is not waiting a response\n")));
00336     }
00337 }

ACE_INLINE TAO_Transport * TAO_ServerRequest::transport  
 

Return the underlying transport.

Definition at line 113 of file TAO_Server_Request.i.

References transport_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context, and TAO_Codeset_Manager::process_service_context.

00114 {
00115   return this->transport_;
00116 }


Friends And Related Function Documentation

friend class TAO_AMH_Response_Handler [friend]
 

Declare TAO_AMH_Response_Handler a friend.

The TAO_AMH_Response_Handler class needs to copy part of the state in a TAO_ServerRequest, however, we do not want to expose that state as public members of this class, neither do we want to add modifiers to the TAO_AMH_Response_Handler class that would allow us (the TAO_ServerRequest class) to set the state.

Lucky for us, C++ is a language for adult developers, and allow us to use the evil "friend" declaration.

Definition at line 68 of file TAO_Server_Request.h.


Member Data Documentation

CORBA::Boolean TAO_ServerRequest::argument_flag_ [private]
 

An argument flag to indicate whether there is any data that is going to get marshalled along as a reply. The default will be 1 which indicates that we have some data that needs to be sent back to the client.

Definition at line 290 of file TAO_Server_Request.h.

Referenced by argument_flag, and init_reply.

CORBA::Boolean TAO_ServerRequest::deferred_reply_ [private]
 

0: Reply would be sent by the object of this class which is the default. 1: Reply would not be prepared by this class and it would be deferred for somebody.

Definition at line 251 of file TAO_Server_Request.h.

Referenced by deferred_reply.

ptr_arith_t TAO_ServerRequest::dsi_nvlist_align_ [private]
 

Used to pad CDR stream if we have used DSI.

Definition at line 282 of file TAO_Server_Request.h.

Referenced by dsi_nvlist_align, init_reply, and send_no_exception_reply.

CORBA::ULong TAO_ServerRequest::exception_type_ [private]
 

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

Definition at line 259 of file TAO_Server_Request.h.

Referenced by exception_type, and init_reply.

CORBA::Object_var TAO_ServerRequest::forward_location_ [private]
 

Definition at line 230 of file TAO_Server_Request.h.

Referenced by forward_location, and init_reply.

TAO_InputCDR* TAO_ServerRequest::incoming_ [private]
 

Incoming stream.

Definition at line 233 of file TAO_Server_Request.h.

Referenced by incoming.

size_t TAO_ServerRequest::interceptor_count_ [private]
 

The number of interceptors pushed on to the current interceptor flow stack.

Definition at line 295 of file TAO_Server_Request.h.

CORBA::Boolean TAO_ServerRequest::is_dsi_ [private]
 

Did we get passed to a CORBA::ServerRequest?

Definition at line 279 of file TAO_Server_Request.h.

Referenced by init_reply, is_dsi, and send_no_exception_reply.

TAO_Pluggable_Messaging* TAO_ServerRequest::mesg_base_ [private]
 

Definition at line 225 of file TAO_Server_Request.h.

Referenced by init_reply, send_no_exception_reply, and tao_send_reply_exception.

ACE_CString TAO_ServerRequest::operation_ [private]
 

Operation name.

Definition at line 228 of file TAO_Server_Request.h.

Referenced by operation, and operation_length.

TAO_ORB_Core* TAO_ServerRequest::orb_core_ [private]
 

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

Definition at line 263 of file TAO_Server_Request.h.

Referenced by orb, orb_core, and tao_send_reply_exception.

TAO_OutputCDR* TAO_ServerRequest::outgoing_ [private]
 

Outgoing stream.

Definition at line 236 of file TAO_Server_Request.h.

Referenced by init_reply, and outgoing.

TAO_Tagged_Profile TAO_ServerRequest::profile_ [private]
 

The tagged profile that has the addressing information.

Definition at line 273 of file TAO_Server_Request.h.

Referenced by object_key, profile, and TAO_ServerRequest.

TAO_Service_Context TAO_ServerRequest::reply_service_context_ [private]
 

Definition at line 267 of file TAO_Server_Request.h.

Referenced by reply_service_context.

CORBA::ULong TAO_ServerRequest::request_id_ [private]
 

Unique identifier for a request.

Definition at line 270 of file TAO_Server_Request.h.

Referenced by init_reply, request_id, send_no_exception_reply, and tao_send_reply_exception.

TAO_Service_Context TAO_ServerRequest::request_service_context_ [private]
 

Service Context info.

Definition at line 266 of file TAO_Server_Request.h.

Referenced by request_service_context.

CORBA_OctetSeq_var TAO_ServerRequest::requesting_principal_ [private]
 

Identifies the requester.

Definition at line 276 of file TAO_Server_Request.h.

Referenced by requesting_principal.

CORBA::Boolean TAO_ServerRequest::response_expected_ [private]
 

0: oneway (SYNC_NONE or SYNC_WITH_TRANSPORT) 1: twoway, or oneway (SYNC_WITH_SERVER or SYNC_WITH_TARGET).

Definition at line 243 of file TAO_Server_Request.h.

Referenced by response_expected, and tao_send_reply_exception.

TAO_PICurrent_Impl TAO_ServerRequest::rs_pi_current_ [private]
 

The "Request Scope Current" (RSC) object, as required by Portable Interceptors.

Definition at line 299 of file TAO_Server_Request.h.

CORBA::Boolean TAO_ServerRequest::sync_with_server_ [private]
 

1: oneway (SYNC_WITH_SERVER) 0: anything else.

Definition at line 255 of file TAO_Server_Request.h.

Referenced by sync_with_server.

TAO_Transport* TAO_ServerRequest::transport_ [private]
 

Transport class.

Definition at line 239 of file TAO_Server_Request.h.

Referenced by init_reply, send_no_exception_reply, tao_send_reply, tao_send_reply_exception, and transport.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:39:29 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002